<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Patrick Organ on Medium]]></title>
        <description><![CDATA[Stories by Patrick Organ on Medium]]></description>
        <link>https://medium.com/@patorgan?source=rss-d96898f327a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MyVYeSBdjBtPJcAX</url>
            <title>Stories by Patrick Organ on Medium</title>
            <link>https://medium.com/@patorgan?source=rss-d96898f327a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:12:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@patorgan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Authoring Great Pull Requests]]></title>
            <link>https://patorgan.medium.com/authoring-great-pull-requests-e4bb73aa01ee?source=rss-d96898f327a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4bb73aa01ee</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[guidelines]]></category>
            <dc:creator><![CDATA[Patrick Organ]]></dc:creator>
            <pubDate>Sat, 01 May 2021 09:27:42 GMT</pubDate>
            <atom:updated>2021-05-01T09:27:42.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xa5c3nHryjzWbqSxYQQMag.png" /></figure><p>Creating high quality pull requests takes practice. They pay off in the long run, though — being known as a developer whose PRs are worth reviewing will work to your benefit. Conversely, being known as a developer that submits poor pull requests will only work against you.</p><p>There are a number of best practices to follow when submitting a quality pull request. The goal is to help the reviewer understand the problem you’re trying to solve, understand what changes have been made, and ultimately to feel that the PR is worth merging.</p><p>— -</p><h3>Create a PR… or don’t.</h3><p>When you decide to submit a pull request, make sure you’re putting in the same effort that the project’s author would. If you can’t be bothered to put in the work necessary for a quality pull request, it’ll be clear to the reviewer. This means at most your PR may be rejected, and at a minimum you’ve wasted time.</p><p>Let’s cover ten guidelines that will help you submit high quality pull requests that are more frequently accepted and merged.</p><h3>1. Have a good basis for creating the PR</h3><p>Make sure you have a reason for submitting a pull request that you can articulate to others. If you’re not clear on the _why_, it’s hard to make sure the PR is complete and of an acceptable quality.</p><p>— -</p><h3>2. Limit the scope</h3><p>A good pull request adds a single feature or fixes a single bug. Keep things clean and simple — if you need to fix multiple bugs or add multiple features, submit separate PRs.</p><p>Try to limit the number of files modified to 8 or less and the total number of line additions to 300 or less. _These numbers are arbitrary but should provide a general idea of appropriate limits._</p><p>Keeping the pull request at a manageable size means the reviewer is more likely to fully understand and merge your work.</p><p>— -</p><h3>3. Review your code</h3><p>Review your changes at least twice before submitting a pull request. You don’t want to submit code with amateur mistakes that reflect poorly on your skills.</p><p>Github displays all changes when creating a PR (but before submitting). Take this opportunity to do a final review of your work.</p><p>Keep in mind that the PR is public and by its nature is inviting scrutiny of your code. Make sure you’re submitting code that you’re proud of.</p><p>— -</p><h3>4. Submit a coherent commit history</h3><p>Make sure the commit history being submitted makes sense and that the messages are descriptive.</p><p>The reviewer may use the commit messages to get a better handle on the changes you’ve made. If they’re a mess or unhelpful, it’s less likely your PR will be merged.</p><p><em>Commit history tips:<br></em>- Squash _’wip’_ commits or commits with similar messages.<br>- Keep commits small and focused on a single change or set of related changes.</p><p>— -</p><h3>5. Include automated</h3><p>Include unit and/or feature tests for all changes made to the code. If you didn’t write any tests, your PR is not ready to be submitted.</p><p>How else can the reviewer be sure that the code not only works but also doesn’t break existing features?</p><p>— -</p><h3>6. Take responsibility for changes</h3><p>If you change or add functionality and there’s existing documentation, it needs to be updated. Take ownership of the changes you’re making and update the documentation to reflect those changes. The reviewer will appreciate the extra effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*mtQCpnBr0qfiV08H0umC1Q.png" /></figure><p><em>Tips for increasing the quality of your PR:</em><br>- update the documentation and/or readme whenever possible<br>- if appropriate, update the changelog</p><p>— -</p><h3>7. Follow the author’s lead</h3><p>Remember that this isn’t your project, and you don’t get to decide what code style or formatting is used. Follow the lead of the author and use the same formatting and style.</p><p>Make sure you’re also following the coding principles and practices that exist in the project’s code.</p><p>— -</p><h3>8. Use a descriptive title</h3><p>The pull request’s title is the first thing a reviewer will see. Having an efficient, meaningful title is the first step to your submission being reviewed quickly.</p><p>Let’s look at an example of a poorly written title <em>(and description)</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*-zGGoyhBXQwFh7eCjSpglg.png" /><figcaption>A poorly written PR title</figcaption></figure><p>And an example of an effective and meaningful title:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*--oON4cFax75Yd4GjoNmVw.png" /><figcaption>An effective and meaningful PR title</figcaption></figure><p>— -</p><h3>9. Provide a thorough description</h3><p>Make sure you provide a clear context for the pull request: define the problem and summarize your solution in the first few lines. Once you’re happy with the overview, start a new paragraph and go into detail about the specifics of the PR.</p><p>Whenever possible, explain the reasoning behind the creation of the PR using facts, data and references. Try to make the best possible case for accepting the pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*hGA9DIMHMJlzIO-cGRCZow.png" /></figure><p>When you don’t have references or data, provide a clearly articulated rationale for why the PR should be accepted; include examples if possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*h5G4bkiMcsEEso0d1yGc-Q.png" /></figure><p>If there were several ways of implementing a solution, explain your decision-making process for choosing the specific implementation over others.</p><p>The purpose of a description isn’t just to summarize the changes a PR makes; it’s also an opportunity to convince the reviewer that your code is worth merging into their project.</p><p><em>Tips for composing an effective description:</em><br>- include screenshots or other media if it clarifies a point<br>- don’t include unrelated images, animated gifs or memes<br>- include links to references such as issues/tickets and related info or documentation<br>- include notes for the reviewer when appropriate to point out less-obvious things</p><p>— -</p><h3>10. Stay engaged</h3><p>Keep an eye on your pull request once you’ve submitted it — the reviewer may provide feedback or request changes before they’ll accept it.</p><p>Acknowledge all comments on your pull request, both positive and negative. You may or may not like all of the comments, but they’re an opportunity to learn from your mistakes and to become a better developer.</p><p>On occasion you may need to accept that you submitted a PR that could have been better. Acknowledge any mistakes you made and learn from them; you’ll have an opportunity to do a better job with the next one.</p><p>A note on communication:</p><p><em>Remember that online criticism is frequently and easily misinterpreted. Don’t jump to conclusions or assume someone was being a jerk. Give people the benefit of the doubt.</em></p><p>— -</p><h3>In closing</h3><p>Creating excellent, high-quality pull requests takes experience. There’s no better time to start learning by contributing to projects on Github.</p><p>If you’re not sure where to start, take a look at projects or packages that you use frequently. Submitting pull requests for code you’re familiar with will help ensure that they’re of a higher quality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4bb73aa01ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consistent code formatting across all of your PHP projects]]></title>
            <link>https://patorgan.medium.com/consistent-code-formatting-across-all-of-your-php-projects-c832108321ad?source=rss-d96898f327a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c832108321ad</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Patrick Organ]]></dc:creator>
            <pubDate>Sat, 09 Jan 2021 01:44:39 GMT</pubDate>
            <atom:updated>2021-01-09T01:44:39.173Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>When working on a project as a developer, having code that is following a standard — linted and consistently formatted — provides huge benefits. It increases readability and improves productivity, allowing you to focus on writing quality code.</p><blockquote><a href="https://www.perforce.com/blog/qac/what-lint-code-and-why-linting-important"><strong>What Is Linting and why is it important?</strong></a></blockquote><blockquote>Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise known as linter). A lint tool is a basic static code analyzer.</blockquote><blockquote>Linting is important to reduce errors and improve the overall quality of your code. Using lint tools can help you accelerate development and reduce costs by finding errors earlier.</blockquote><blockquote>— Richard Bellairs, Perforce Blog</blockquote><h3>PHP-CS-Fixer</h3><p>An extremely configurable tool from <a href="https://www.symfony.com/">Symfony</a>, <a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer">php-cs-fixer</a>, can lint and format all PHP code in a project by executing a single command.</p><p>It will lint and format all PHP files indicated in its configuration fairly quickly and with relatively low memory usage. The catch, of course, is that it must first be configured.</p><p>The downside is that there are <a href="https://cs.symfony.com/doc/rules/index.html">so many configuration options</a> that it can take a long time to configure, and the resulting file is difficult to manage, especially if you’re using the same file across many projects.</p><h3>Duplicated Configuration Files</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*UFph6OOk_rCPd99NUTeAPw.png" /><figcaption>excerpt from a common php-cs-fixer configuration</figcaption></figure><p>Configurations are often quite long due to the number of choices — <em>there are over 200 configuration options</em>.</p><p>Many developers end up copy-and-pasting configuration files into each new project, resulting in many duplicate files.</p><p>Making any changes means that every duplicated file needs to be updated manually.</p><h3>Implementing Shared Configurations</h3><p><a href="https://github.com/permafrost-dev/phpcsfixer-preset">permafrost-dev/phpcsfixer-preset</a></p><p>The <a href="https://github.com/permafrost-dev/phpcsfixer-preset">permafrost-dev/phpcsfixer-preset</a>composer package allows developers to use a shared php-cs-fixer configuration across all of their projects — if the linting rules are updated, every project using the package automatically gets the new configuration. This means that the days of copy-and-pasting configuration files have come to and end.</p><h3>About the package</h3><p>This package allows you to use the same php-cs-fixer rules across all of your projects without copy-and-pasting configuration files. There’s also a quick setup script to automatically generate a configuration file for your project structure and preferred formatting preset.</p><p>It provides several opinionated php-cs-fixer configuration choices as well as predefined Finder classes for common project layouts and use cases.</p><p>The configuration it uses is much more concise and easier to work with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*ymLUP5_jrGZMd2z2ftStcw.png" /><figcaption>Sample phpcsfixer-preset configuration for php-cs-fixer</figcaption></figure><h3>Package Installation</h3><p>You can install the package using composer:</p><p>composer require permafrost-dev/phpcsfixer-preset --dev</p><p>You may need to install php-cs-fixer as well:</p><p>composer require friendsofphp/php-cs-fixer --dev</p><h3>Generate a configuration file</h3><p>To quickly generate a configuration file that takes advantage of the shared rules, run the follow command in your terminal <em>(assuming you’re working on a </em><a href="https://laravel.com/"><em>Laravel</em></a><em> project)</em>:</p><pre>vendor/bin/pf-create-cs-config laravel</pre><p>If you’re not working with <a href="https://laravel.com/">Laravel</a>, there are other predefined project types available. See the package’s <a href="https://github.com/permafrost-dev/phpcsfixer-preset/blob/main/README.md">documentation</a> for details.</p><h3>Format your code</h3><p>Finally, you should lint and format your code with php-cs-fixer by running the following command in your terminal:</p><pre>vendor/bin/php-cs-fixer fix</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*LrcyVEY-ERvha6HIjo5Axw.png" /><figcaption>php-cs-fixer in action, formatting a Laravel project’s code.</figcaption></figure><h3>$developer-&gt;efficiency++;</h3><p>Eliminating the need to keep many configuration files in sync means you can spend more time worrying about not just writing code, but writing higher-quality code — and less about tooling configurations.</p><h3>References</h3><ul><li><a href="https://github.com/permafrost-dev/phpcsfixer-preset">permafrost-dev/phpcsfixer-preset</a></li><li><a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer">GitHub - FriendsOfPHP/PHP-CS-Fixer: A tool to automatically fix PHP Coding Standards issues</a></li><li><a href="https://cs.symfony.com/doc/rules/index.html">PHP Coding Standards Fixer</a></li><li><a href="https://laravel.com/">Laravel - The PHP Framework For Web Artisans</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c832108321ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>