Skip to content

Commit

Permalink
Namespaces on own line (roots#1712)
Browse files Browse the repository at this point in the history
`namespace` declarations appear on their own line in PHP FIG examples as well as in common PHP frameworks. While not officially part of PSR-2, we should still follow this common practice of not putting `namespace` declaration on the same line as `<?php`.

- http://www.php-fig.org/psr/psr-2/
- https://github.com/laravel/laravel/blob/master/app/User.php#L1-L3
- https://github.com/symfony/filesystem/blob/master/Filesystem.php#L1-L12
- https://github.com/zendframework/zend-mail/blob/master/src/Address.php#L1-L10
  • Loading branch information
kalenjohnson authored and QWp6t committed Sep 9, 2016
1 parent a05c869 commit 2124163
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/admin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App;
<?php

namespace App;

/**
* Theme customizer
Expand Down
4 changes: 3 additions & 1 deletion src/filters.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App;
<?php

namespace App;

use Roots\Sage\Template;
use Roots\Sage\Template\Wrapper;
Expand Down
4 changes: 3 additions & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App;
<?php

namespace App;

use Roots\Sage\Asset;
use Roots\Sage\Assets\JsonManifest;
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Asset.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage;
<?php

namespace Roots\Sage;

use Roots\Sage\Assets\ManifestInterface;

Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Assets/JsonManifest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage\Assets;
<?php

namespace Roots\Sage\Assets;

/**
* Class JsonManifest
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Assets/ManifestInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage\Assets;
<?php

namespace Roots\Sage\Assets;

/**
* Interface ManifestInterface
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Template.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage;
<?php

namespace Roots\Sage;

use Roots\Sage\Template\Partial;
use Roots\Sage\Template\WrapperInterface;
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Template/Partial.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage\Template;
<?php

namespace Roots\Sage\Template;

class Partial
{
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Template/Wrapper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage\Template;
<?php

namespace Roots\Sage\Template;

/**
* Class Wrapper
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Sage/Template/WrapperInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Roots\Sage\Template;
<?php

namespace Roots\Sage\Template;

/**
* Interface WrapperInterface
Expand Down
4 changes: 3 additions & 1 deletion src/setup.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App;
<?php

namespace App;

use Roots\Sage\Template;

Expand Down

0 comments on commit 2124163

Please sign in to comment.