Page MenuHomePhabricator

Add a linter rule to ensure that `namespace` is the first statement in a file
ClosedPublic

Authored by joshuaspence on Nov 19 2015, 10:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 7:50 AM
Unknown Object (File)
Mon, Apr 1, 2:37 AM
Unknown Object (File)
Tue, Mar 26, 6:43 AM
Unknown Object (File)
Sat, Mar 23, 3:10 PM
Unknown Object (File)
Sat, Mar 23, 2:15 PM
Unknown Object (File)
Sat, Mar 23, 10:53 AM
Unknown Object (File)
Wed, Mar 20, 3:47 PM
Unknown Object (File)
Wed, Mar 20, 1:48 PM
Subscribers

Details

Summary

If a namespace is used within a PHP script, it must be the first statement.

Test Plan

Added unit tests.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add a linter rule to ensure that `namespace` is the first statement in a file.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
<?php

1;

namespace X {
  class C { }
  echo 2;
}

Look at me, I'm PHP!

This revision is now accepted and ready to land.Nov 19 2015, 10:18 PM
joshuaspence edited edge metadata.

Add a test case for an edge case

This revision was automatically updated to reflect the committed changes.