add (alpha) support to namespace #15

Closed
wants to merge 33 commits into
from

Projects

None yet

4 participants

@iannsp
iannsp commented Apr 1, 2012

Add algorithm to support namespace documentation

the interface is
$doc = new Doc('Respect\Doc', Doc::DOCNS);

@iannsp iannsp referenced this pull request Apr 1, 2012
Open

Namespace Doc classes #9

@alganet
Member
alganet commented Apr 2, 2012

PR #15 is doing two things: It implements namespaces in the Doc project itself and also adds support to loading files to document namespaces.

I prefer an API without the mode parameter. If the user sets $doc = new Doc('Zend\'); we should imply that is a namespace (after all, it ends with a namespace separator). Same for $doc = new Doc('Zend_'); and the old fake-namespace standard. However, I'm in a middle of a flu, maybe my brain is tricking me, anyone sees any disadvantage on this approach? We also need some tests for this!

@iannsp
iannsp commented Apr 2, 2012

@alganet, this approach is really better then use mode parameter.
I don't think recognize '' to NS and / to DIR, really!!!! Probably I'm blind or drunk(or both) ;)

Gonna fix it and apply a new PR.

@nickl- nickl- commented on the diff Aug 29, 2012
tests/library/Respect/Doc/NameSpaceAnalizerTest.php
+namespace Respect\Doc;
+
+class NameSpaceAnalizerTest extends \phpunit_framework_testcase
+{
+ private $ns;
+ public function setUp()
+ {
+ $this->ns = new NameSpaceAnalizer();
+ }
+ public function tearDown()
+ {
+ $this->namespace = null;
+ }
+ public function testget()
+ {
+ $class = new MarkDown();
@nickl-
nickl- Aug 29, 2012 Respect member

Hey where's this guy going? Tie that mark down down... =)

@augustohp
augustohp Aug 29, 2012 Respect member

Yep, this should not be there...

@nickl-
Member
nickl- commented Aug 29, 2012

I see tests like @alganet requested,

I see some really some really crucial fixes.
I see some interesting additions.
I see this only now for the first time.

I see no reason not to commit this to the develop branch.
Took a little persuasion but all done, thanx @iannsp I can't wait to have a look and see! =)

@nickl- nickl- closed this Aug 29, 2012
@augustohp
Member

Maybe pushing this to a branch called namespaces would be better, we can discuss that there with code and through commit messages.... what do you all think!?

@alganet
Member
alganet commented Aug 29, 2012

Let's merge it! We can improve it later, we're all good at this =D

@nickl-
Member
nickl- commented Aug 29, 2012

Exactly, the patch also has general fixes that should definitely get onto track.

If we don't like something we change it, the question should really only be:

a) Is it working? No use have broken sh... stuff.
b) Is it an improvement, change arguably is already an improvement =)

Lets keep the wheels rolling this was lying around for 5 months!!!! That's a lifetime for many most pieces of source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment