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
F13133863: D14526.diff
Wed, May 1, 11:55 PM
Unknown Object (File)
Thu, Apr 25, 1:01 AM
Unknown Object (File)
Wed, Apr 24, 9:08 AM
Unknown Object (File)
Wed, Apr 24, 9:07 AM
Unknown Object (File)
Fri, Apr 5, 7:50 AM
Unknown Object (File)
Apr 1 2024, 2:37 AM
Unknown Object (File)
Mar 26 2024, 6:43 AM
Unknown Object (File)
Mar 23 2024, 3:10 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
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 9071
Build 10678: Run Core Tests
Build 10677: 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.