# PHP7 and types

- Thread: https://externals.io/message/87108
- Original archive: https://news-web.php.net/php.internals/87108
- Started by Ryan Pallas on 2015-07-11T16:04:32+00:00
- Messages: 33
- Page 1 of 2: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/87108.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #87108 — Ryan Pallas — 2015-07-11T16:04:32+00:00

URL: https://externals.io/message/87108#87108

With all the new typing and strict mode in PHP7, I'm wondering if there is
any planned support for typing of properties in a future version. IE
something like:

class Foo {}
class Bar {
   public Foo $foo;

   public function __construct(Foo $foo) {
       $this->foo = $foo;
   }
}

This seems really useful to me. If its not something that was considered
before I can try to write up an RFC for this, however I'm not sure if this
was already considered and denied. Any feedback would be greatly
appreciated.

-Ryan

---

## #87109 — S.A.N — 2015-07-11T17:53:45+00:00

URL: https://externals.io/message/87108#87109 · In reply to: #87108

+1
It will be useful for autocomplete in IDE

---

## #87110 — Sebastian Bergmann — 2015-07-11T18:41:57+00:00

URL: https://externals.io/message/87108#87110 · In reply to: #87109

Am 11.07.2015 um 19:53 schrieb S.A.N:
> It will be useful for autocomplete in IDE

 That argument is bogus since proper IDEs (PhpStorm, fex.) leverage
 docblock annotations for that already.

---

## #87112 — Ryan Pallas — 2015-07-11T19:25:18+00:00

URL: https://externals.io/message/87108#87112 · In reply to: #87110

On Sat, Jul 11, 2015 at 12:41 PM, Sebastian Bergmann <sebastian@php.net>
wrote:

> Am 11.07.2015 um 19:53 schrieb S.A.N:
> > […]
>
>  That argument is bogus since proper IDEs (PhpStorm, fex.) leverage
>  docblock annotations for that already.
>
> Agreed. I don't know any IDE meant for PHP that doesn't respect docblock
declarations.

I think the benefit comes more in being able to make a property public, and
still have control over its type. Currently the only way to do it is to
have your property be private and use public get/set method(s) instead. IE:
class foo {
   public int $bar;
}

-- vs. --

class foo {
   private $bar = 0;
   public function getBar() : int {
      return $this->bar;
   }
   public function setBar(int $val) {
      $this->bar = $val;
   }
}

Granted its still far less verbose for scalar types than in the current 5.x
world where you have to have your own type checks as well.

---

## #87115 — Marcio Almada — 2015-07-12T02:41:03+00:00

URL: https://externals.io/message/87108#87115 · In reply to: #87110

Hi,

2015-07-11 15:41 GMT-03:00 Sebastian Bergmann <sebastian@php.net>:
> Am 11.07.2015 um 19:53 schrieb S.A.N:
> > […]
>
>  That argument is bogus since proper IDEs (PhpStorm, fex.) leverage
>  docblock annotations for that already.
>
> --
> 
> 
>

Not completely bogus. At least with typed properties you won't need to
actually write the docblocks to have the IDE "hints". It's a minor win
for IDE users too.

Marcio

---

## #87116 — Stanislav Malyshev — 2015-07-12T08:10:00+00:00

URL: https://externals.io/message/87108#87116 · In reply to: #87115

Hi!

> Not completely bogus. At least with typed properties you won't need to
> actually write the docblocks to have the IDE "hints". It's a minor win
> for IDE users too.

I don't see "not needing to write docblocks" as a win, quite the
contrary. In fact, in a number of projects I worked with, code without
proper documentation (including docblocks) simply wasn't accepted into
the repository.

While I don't think this needs to be mandatory, I also don't see major
difference - so you have to write type instead of docblock, you still
have to write something.

-- 
Stas Malyshev
smalyshev@gmail.com

---

## #87118 — Lester Caine — 2015-07-12T08:27:12+00:00

URL: https://externals.io/message/87108#87118 · In reply to: #87116

> > […]
> I don't see "not needing to write docblocks" as a win, quite the
> contrary. In fact, in a number of projects I worked with, code without
> proper documentation (including docblocks) simply wasn't accepted into
> the repository.
> 
> While I don't think this needs to be mandatory, I also don't see major
> difference - so you have to write type instead of docblock, you still
> have to write something.

In addition, the docblock contains a lot more material than just a few
types, so one still needs to have one. The main problem with adding
types is they become part of the code, while a docblock can simple be
stripped.

As a 'minor win for IDE users' it is also questionable since the every
IDE will need to be re-written to support both methods of working.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #87120 — Marcio Almada — 2015-07-12T16:16:53+00:00

URL: https://externals.io/message/87108#87120 · In reply to: #87116

Stas,

2015-07-12 5:10 GMT-03:00 Stanislav Malyshev <smalyshev@gmail.com>:
> Hi!
>
> > […]
>
> I don't see "not needing to write docblocks" as a win, quite the
> contrary.

Of course it's a win. Or do you like to write docblocks for every
single class property or method (even when the member is obvious) just
to have a "@var" so your IDE can work?

Not to mention you won't get any runtime/compile time check or
optimization from docblock tags, that's the main point of having typed
properties.

> In fact, in a number of projects I worked with, code without
> proper documentation (including docblocks) simply wasn't accepted into
> the repository.
>

If you are using the term "proper documentation" to justify docblocks
everywhere even if they contain just a "/** @var string */", it's a
sign we've been using comments against us all this time (even if we
called it "doc comments").

But thankfully we are moving PHP to another direction. Do you remember
the "return types" voting results?
https://wiki.php.net/rfc/return_types#vote. That's because "function()
: type" is self documented and much more maintainable than than a
possibly sloppy "/** @return type */" on top of every method on a
codebase.

> While I don't think this needs to be mandatory, I also don't see major
> difference - so you have to write type instead of docblock, you still
> have to write something.
>

But with the benefits already cited above. Docblocks should not be a
place for type information anymore, this was a workaround and we've
been slowly replacing it with a better solution (opt in types).
Property types seems to be the next logical step after adding return
types and scalar types.

> --
> Stas Malyshev
> smalyshev@gmail.com

Is there any technical reason for you to be against typed properties?
IMMO, just arguing against opt in type declarations (evolving the php
type system) in favor of docblocks (stagnation) seems to be utterly
unproductive as we already know the tendencies from previous votings.

Marcio

---

## #87121 — Marcio Almada — 2015-07-12T16:36:20+00:00

URL: https://externals.io/message/87108#87121 · In reply to: #87118

Lester,

2015-07-12 5:27 GMT-03:00 Lester Caine <lester@lsces.co.uk>:
> 
> > […]
>
> In addition, the docblock contains a lot more material than just a few
> types, so one still needs to have one. The main problem with adding
> types is they become part of the code, while a docblock can simple be
> stripped.
>

Please refer to reply given to Stas.

> As a 'minor win for IDE users' it is also questionable since the every
> IDE will need to be re-written to support both methods of working.
>

You meant "updated" not "re-written". IDEs that want to stay relevant
to the community will always be updated, and hæck, it's much easier to
analyze real language syntax as opposed to uncertain user space DSLs
inside comments. IDE maintainers won't complain about that, for sure.

> 
> 
>

Marcio

---

## #87122 — S.A.N — 2015-07-12T17:35:26+00:00

URL: https://externals.io/message/87108#87122 · In reply to: #87121

Of course the main target - check types, but not all use the check
types, but almost everyone uses Ide, so I said, it is actual and
useful.

I do not see contradictions, everyone who wants to write PHP 5 code,
need use DocBlock @var.

I hope that in the PHP 7.x, DocBlock is only for documentation of
code, all declared types be in the language and not in the comments

I would like it to be implemented, not beginning of unnecessary disputes.

Thank.

---

## #87123 — Larry Garfield — 2015-07-12T19:37:22+00:00

URL: https://externals.io/message/87108#87123 · In reply to: #87120

> Stas,
>
> 2015-07-12 5:10 GMT-03:00 Stanislav Malyshev <smalyshev@gmail.com>:
> > […]
> Of course it's a win. Or do you like to write docblocks for every
> single class property or method (even when the member is obvious) just
> to have a "@var" so your IDE can work?
>
> Not to mention you won't get any runtime/compile time check or
> optimization from docblock tags, that's the main point of having typed
> properties.
>
> > […]
> If you are using the term "proper documentation" to justify docblocks
> everywhere even if they contain just a "/** @var string */", it's a
> sign we've been using comments against us all this time (even if we
> called it "doc comments").
>
> But thankfully we are moving PHP to another direction. Do you remember
> the "return types" voting results?
> https://wiki.php.net/rfc/return_types#vote. That's because "function()
> : type" is self documented and much more maintainable than than a
> possibly sloppy "/** @return type */" on top of every method on a
> codebase.
>
> > […]
> But with the benefits already cited above. Docblocks should not be a
> place for type information anymore, this was a workaround and we've
> been slowly replacing it with a better solution (opt in types).
> Property types seems to be the next logical step after adding return
> types and scalar types.

I don't know why we're even talking about IDEs here.  IDE 
auto-completion isn't the point, anymore than it was the point for 
scalar type hints or return type hints.  It's about the language doing 
type checking for you and static analysis, so that the language can find 
bugs for you. Eg:

class Foo {
   public Bar $bar;
}

$f = new Foo();
$f->bar = new Baz(); // This line is clearly wrong and the compiler can 
check it for you.

That's what the benefit would be.  Easier IDE auto-completion is a nice 
extra, but not the main goal.

+1 from me in 7.1.

--Larry Garfield

---

## #87124 — Alan Willms — 2015-07-12T22:51:00+00:00

URL: https://externals.io/message/87108#87124 · In reply to: #87123

What about arrays? How do I declare Foo[] ?

http://ocramius.github.io/extremely-defensive-php/#/69

2015-07-12 16:37 GMT-03:00 Larry Garfield <larry@garfieldtech.com>:

> 
>
> > […]
>
> I don't know why we're even talking about IDEs here.  IDE auto-completion
> isn't the point, anymore than it was the point for scalar type hints or
> return type hints.  It's about the language doing type checking for you and
> static analysis, so that the language can find bugs for you. Eg:
>
> class Foo {
>   public Bar $bar;
> }
>
> $f = new Foo();
> $f->bar = new Baz(); // This line is clearly wrong and the compiler can
> check it for you.
>
> That's what the benefit would be.  Easier IDE auto-completion is a nice
> extra, but not the main goal.
>
> +1 from me in 7.1.
>
> --Larry Garfield

---

## #87125 — Ryan Pallas — 2015-07-12T23:08:10+00:00

URL: https://externals.io/message/87108#87125 · In reply to: #87124

> What about arrays? How do I declare Foo[] ?
>
> http://ocramius.github.io/extremely-defensive-php/#/69
>
> 2015-07-12 16:37 GMT-03:00 Larry Garfield <larry@garfieldtech.com>:
>
> > […]
> and
> > […]
>
> Since there is not typed arrays in PHP I would say you declare it as an
array. Though in this case I would suggest a collection class that
implements iterator and countable and type hint for this collection and
make its job be to be a container of a specific type.

class WagonCollection implements Iterator, Countable {
   private array $wagons = [];
   private int $index = 0;

   public function addWagon(Wagon $w) {
      $this->wagons[] = $w;
   }

   // implementations for Iterator and Countable
}

However, I could see an argument being made for typed arrays, but that is
not the point of my suggested RFC and a separate RFC would need to be
created for that.

PS. Please bottom post instead of top posting. mailing list rules
<http://git.php.net/?p=php-src.git;a=blob_plain;f=README.MAILINGLIST_RULES;hb=HEAD

---

## #87126 — Rasmus Lerdorf — 2015-07-13T00:12:23+00:00

URL: https://externals.io/message/87108#87126 · In reply to: #87123

> I don't know why we're even talking about IDEs here.  IDE
> auto-completion isn't the point, anymore than it was the point for
> scalar type hints or return type hints.  It's about the language doing
> type checking for you and static analysis, so that the language can find
> bugs for you. Eg:
> 
> class Foo {
>   public Bar $bar;
> }
> 
> $f = new Foo();
> $f->bar = new Baz(); // This line is clearly wrong and the compiler can
> check it for you.
> 
> That's what the benefit would be.  Easier IDE auto-completion is a nice
> extra, but not the main goal.
> 
> +1 from me in 7.1.

I am not sure static analysis is a great argument for it either. A
static analyzer can read the docblock really easily too since it is part
of the AST node for the property. In fact I just wrote one. Feeding it
your code example:

% cat -n test.php
     1	<?php
     2	class Baz { }
     3	class Foo {
     4		/** @var Bar $bar */
     5		public $bar;
     6	}
     7	
     8	$f = new Foo();
     9	$f->bar = new Baz();

% ./phan test.php
Files scanned: 1
Time:		0.11s
Classes:	2
Methods:	0
Functions:	0
Closures:	0
Traits:		0
Conditionals:	0
Issues found:	1

test.php:9 TypeError property is declared to be bar but was assigned Baz

Plus, without union types, doc-comment typing is much more convenient
when it comes to running a static analyzer on real-world code since
limiting everything to a single type is often impractical. If you grep
through existing code in the wirld, you will find a ton of Bar|bool,
Bar|Baz|bool|null, etc.

I'm not against the idea, but it is quite different from the existing
type checking since this is a type check that would need to be done on
every assignment for it to make any sense at all and not just at call
boundaries like the existing ones. It may not be feasible to do in an
efficient manner. A static analyzer can get away with catching 95%. A
core language feature can't. Having to do these the type check on
assignment will likely require some significant changes to the engine.

-Rasmus

---

## #87127 — Rasmus Lerdorf — 2015-07-13T01:34:30+00:00

URL: https://externals.io/message/87108#87127 · In reply to: #87126

> 
> > […]

By the way, I forgot to add that you can't possibly say that this line
is clearly wrong without knowing what Baz is and you didn't define Baz.
So the only thing clearly wrong with that line is that the Baz class
doesn't exist which has nothing to do with the property type.

If you have:

    class Bar { }
    class Baz extends Bar { }

Then that line is perfectly valid since Baz is an instance of Bar which
would meet the type criteria provided. And this also shows that the
compiler can't actually check that necessarily. We don't know whether
Baz is an instance of Bar at compile-time.

-Rasmus

---

## #87128 — Levi Morrison — 2015-07-13T06:45:09+00:00

URL: https://externals.io/message/87108#87128 · In reply to: #87108

I am in favor of typed properties but it's actually a fairly low
priority for me. There are also several questions that need answering,
such as what happens when you type a property with type `Foo` but
don't assign it a value in the constructor. Also, is the check
bypassed with inheritance when you don't call parent constructor?
Given that it's non-trivial (but not necessarily *very* complex) and
only a low priority I haven't taken the time to make a proposal. I am
instead focusing on union, sum and enum types.

---

## #87129 — Stanislav Malyshev — 2015-07-13T07:07:12+00:00

URL: https://externals.io/message/87108#87129 · In reply to: #87120

Hi!

> Of course it's a win. Or do you like to write docblocks for every
> single class property or method (even when the member is obvious) just

Yes. What is obvious to you today may not be at all obvious to your
coworker two years later.

> to have a "@var" so your IDE can work?

No, not "just" my IDE can work. IDE is just the side effect. Proper
documentation does much more than that.

> Not to mention you won't get any runtime/compile time check or
> optimization from docblock tags, that's the main point of having typed
> properties.

I don't see how "compile time check" is even possible, given that PHP
has no "compile time". As for runtime check, it'd be mostly useless for
me - I very rarely have seen bugs that would be caught by such checks.

> If you are using the term "proper documentation" to justify docblocks
> everywhere even if they contain just a "/** @var string */", it's a
> sign we've been using comments against us all this time (even if we
> called it "doc comments").

I'm not sure what "using comments against us" even means. I also do not
share a superstition that comments are somehow evil or that making
comments machine-readable and benefiting from it is somehow wrong.

> But thankfully we are moving PHP to another direction. Do you remember

If you refer to inserting static typing into random places in service of
a cargo cult notion that "more type definitions is always better,
because types fix bugs" - no, I do not think it is a correct direction.

> https://wiki.php.net/rfc/return_types#vote. That's because "function()
> : type" is self documented and much more maintainable than than a
> possibly sloppy "/** @return type */" on top of every method on a
> codebase.

It's not more maintainable and it is much less flexible or useful. PHP
has very nice and flexible capabilities that allow write very nice code
which can return different values in different circumstances. By trying
to shove it into a single type you are ignoring these capabilities -
again because of a superstition that somehow there are myriads of bugs
caused by accidentally returning values of wrong types that are being
fixed by that.

> But with the benefits already cited above. Docblocks should not be a
> place for type information anymore, this was a workaround and we've

Why? There's no reason why they can't be except for a unsupported
statement "it is bad because it is bad".
-- 
Stas Malyshev
smalyshev@gmail.com

---

## #87130 — Robert Stoll — 2015-07-13T07:16:35+00:00

URL: https://externals.io/message/87108#87130 · In reply to: #87126

> -----Ursprüngliche Nachricht-----
> Von: Rasmus Lerdorf [mailto:rasmus@lerdorf.com]
> Gesendet: Montag, 13. Juli 2015 02:12
> An: Larry Garfield; internals@lists.php.net
> Betreff: Re: [PHP-DEV] PHP7 and types
> 
> 
> > […]
> 
> I am not sure static analysis is a great argument for it either. A static analyzer can read the docblock really easily too since it
> is part of the AST node for the property. In fact I just wrote one. Feeding it your code example:
> 
> % cat -n test.php
>      1	<?php
>      2	class Baz { }
>      3	class Foo {
>      4		/** @var Bar $bar */
>      5		public $bar;
>      6	}
>      7
>      8	$f = new Foo();
>      9	$f->bar = new Baz();
> 
> % ./phan test.php
> Files scanned: 1
> Time:		0.11s
> Classes:	2
> Methods:	0
> Functions:	0
> Closures:	0
> Traits:		0
> Conditionals:	0
> Issues found:	1
> 
> test.php:9 TypeError property is declared to be bar but was assigned Baz
> 
> Plus, without union types, doc-comment typing is much more convenient when it comes to running a static analyzer on
> real-world code since limiting everything to a single type is often impractical. If you grep through existing code in the wirld,
> you will find a ton of Bar|bool,
> Bar|Baz|bool|null, etc.
> 
> I'm not against the idea, but it is quite different from the existing type checking since this is a type check that would need to
> be done on every assignment for it to make any sense at all and not just at call boundaries like the existing ones. It may not
> be feasible to do in an efficient manner. A static analyzer can get away with catching 95%. A core language feature can't.
> Having to do these the type check on assignment will likely require some significant changes to the engine.
> 
> -Rasmus

Another point of discussion should be how strict a property type hint will be. Currently, parameter type hints are only binding for the call side but not within the function body.
For instance, function foo(Foo $x){ $x = 1;} is perfectly valid. It certainly has little sense to have the same semantics for properties but then we introduce another inconsistency and should maybe fix the behaviour of parameter type hints first.

---

## #87132 — Rasmus Lerdorf — 2015-07-13T07:40:52+00:00

URL: https://externals.io/message/87108#87132 · In reply to: #87130

> Another point of discussion should be how strict a property type hint will be. Currently, parameter type hints are only binding for the call side but not within the function body.
> For instance, function foo(Foo $x){ $x = 1;} is perfectly valid. It certainly has little sense to have the same semantics for properties but then we introduce another inconsistency and should maybe fix the behaviour of parameter type hints first.

Like I said, adding type checks to every assignment is a rather large
change, and I doubt it can be done without some nasty performance costs.

Honestly, I would rather have a speedy runtime and put the effort into a
static analysis mode built into PHP. The stated goal of so many who push
the strict types everywhere argument is that it helps find bugs. So
let's have an analyze mode that finds these bugs without bogging down
the runtime with thousands of type checks.

-Rasmus

---

## #87133 — Pierre Joye — 2015-07-13T07:49:42+00:00

URL: https://externals.io/message/87108#87133 · In reply to: #87129

>
> Hi!
>
> > […]
>
> Yes. What is obvious to you today may not be at all obvious to your
> coworker two years later.
>
> > […]
>
> No, not "just" my IDE can work. IDE is just the side effect. Proper
> documentation does much more than that.

It seems to go off topic. Docblocks are only slightly related to this
thread. The same could be said about annotation (which are widely used too).

I do like the idea to be allowed to do such thing. It is indeed not a high
priority but still nice to have.

Cheers,
Pierre

---

## #87134 — Lester Caine — 2015-07-13T10:36:03+00:00

URL: https://externals.io/message/87108#87134 · In reply to: #87133

> > […]
> It seems to go off topic. Docblocks are only slightly related to this
> thread. The same could be said about annotation (which are widely used too).

Coming from a background of 'traditional' php design, all of my code and
the libraries I use are documented via phpdoc style annotation which the
IDE picks up, and phpdocumentor1 produced a good API description. This
was also a GOOD basis to tidy up the various changes through PHP5.x

Today much of the infrastructure to make that work is broken and
http://lsces.org.uk/wiki/bitweaver+documentation is a starting point at
getting the material all up to date. The original documentation had a
few errors on the log file, but http://lsces.org.uk/bwdocs2/index.html
is the version I've been working on and is listing 3300 errors in the
documentation! The next step is to work out how to address those errors,
but once again that is unproductive work so perhaps fixing the problems
with the older V1 documenter may be a better use of time? The rules
phpdocumenter2 follow seem far adrift from the original 'standard'. So
it WOULD be nice if there was an approved standard rather than these
seeming to be subject to different interpretation all the time.

This before addressing the problems of PHP7 migration ...

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #87135 — Marco Pivetta — 2015-07-13T10:51:55+00:00

URL: https://externals.io/message/87108#87135 · In reply to: #87134

Hi Lester,



> 
> > […]
> too).
>
> Coming from a background of 'traditional' php design, all of my code and
> the libraries I use are documented via phpdoc style annotation which the
> IDE picks up, and phpdocumentor1 produced a good API description. This
> was also a GOOD basis to tidy up the various changes through PHP5.x
>
> Today much of the infrastructure to make that work is broken and
> http://lsces.org.uk/wiki/bitweaver+documentation is a starting point at
> getting the material all up to date. The original documentation had a
> few errors on the log file, but http://lsces.org.uk/bwdocs2/index.html
> is the version I've been working on and is listing 3300 errors in the
> documentation! The next step is to work out how to address those errors,
> but once again that is unproductive work so perhaps fixing the problems
> with the older V1 documenter may be a better use of time? The rules
> phpdocumenter2 follow seem far adrift from the original 'standard'. So
> it WOULD be nice if there was an approved standard rather than these
> seeming to be subject to different interpretation all the time.
>
> This before addressing the problems of PHP7 migration ...
>
>
Please refer to https://github.com/php-fig/fig-standards/pull/169

Greets,

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

---

## #87136 — Lester Caine — 2015-07-13T11:20:56+00:00

URL: https://externals.io/message/87108#87136 · In reply to: #87135

> Please refer to https://github.com/php-fig/fig-standards/pull/169

This just adds another level of complication. FIG is not part of the
core PHP standards, and some of their choices simply don't fit with
legacy code. I suspect that some of the problems I'm currently hitting
are because the coding standards I follow do not match FIG ... and I
have no intentions of adding that to that todo list ... but I've paid
work to get on with currently before I can get back to documentation.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

---

## #87137 — Marco Pivetta — 2015-07-13T12:12:09+00:00

URL: https://externals.io/message/87108#87137 · In reply to: #87136

> 
> > […]
>
> This just adds another level of complication. FIG is not part of the
> core PHP standards, and some of their choices simply don't fit with
> legacy code. I suspect that some of the problems I'm currently hitting
> are because the coding standards I follow do not match FIG ... and I
> have no intentions of adding that to that todo list ... but I've paid
> work to get on with currently before I can get back to documentation.
>
>
So put a strict no-upgrade-if-without-budget policy on whatever you're
working on then?

phpdocumentor is also not an "official" tool: it's built by volunteers and
outside the boundaries of php-src.

It's actually the PhpDocumentor folks (and Mike van Riel in first place)
pushing forward PSR-5: there's nothing more "official" than that right now.
That's the current standardization path.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

---

## #87138 — Rick Widmer — 2015-07-13T12:19:33+00:00

URL: https://externals.io/message/87108#87138 · In reply to: #87134

> Coming from a background of 'traditional' php design, all of my code and
> the libraries I use are documented via phpdoc style annotation which the
> IDE picks up, and phpdocumentor1 produced a good API description. This
> was also a GOOD basis to tidy up the various changes through PHP5.x
>
> Today much of the infrastructure to make that work is broken and
> http://lsces.org.uk/wiki/bitweaver+documentation  is a starting point at
> getting the material all up to date. The original documentation had a
> few errors on the log file, buthttp://lsces.org.uk/bwdocs2/index.html
> is the version I've been working on and is listing 3300 errors in the
> documentation! The next step is to work out how to address those errors,

Phpdocumentor2?

I don't remember the details, but a single patch cleaned up a ton of 
errors for me.  I googled the error message and found a github? pull 
request or bug report.  The best answer is at the bottom of the 
discussion.  As of the last time I loaded it, about 3 months ago, I 
still had to apply the patch.

---

Next page: https://externals.io/message/87108.md?page=2
