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)
Wed, Feb 5, 9:37 AM
Unknown Object (File)
Thu, Jan 30, 7:10 AM
Unknown Object (File)
Wed, Jan 29, 11:24 AM
Unknown Object (File)
Tue, Jan 28, 12:50 AM
Unknown Object (File)
Tue, Jan 28, 12:50 AM
Unknown Object (File)
Tue, Jan 28, 12:50 AM
Unknown Object (File)
Tue, Jan 28, 12:50 AM
Unknown Object (File)
Fri, Jan 24, 10:02 AM
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
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 8948
Build 10504: Run Core Tests
Build 10503: arc lint + arc unit

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.