Skip to content

Conversation

BenMorel
Copy link
Contributor

The following classes/interfaces in PHP-DS implement ArrayAccess:

  • Map
  • Stack
  • Sequence (Deque, Vector)

But this is not currently documented.


Script to check which classes/interfaces implement ArrayAccess:

$classes = array_merge(get_declared_interfaces(), get_declared_classes());

foreach ($classes as $class) {
    if (substr($class, 0, 3) === 'Ds\\') {
        if ((new ReflectionClass($class))->implementsInterface(ArrayAccess::class)) {
            echo "$class\n";
        }
    }
}
Ds\Sequence
Ds\Vector
Ds\Deque
Ds\Stack
Ds\Map

@cmb69
Copy link
Member

cmb69 commented Oct 23, 2020

Thanks for the PR! Implementing ArrayAccess seems to be a very recent addition for 1.3.0 (php-ds/ext-ds@b297e8f), and that should be mentioned in the manual, possibly as a changelog entry.

@BenMorel
Copy link
Contributor Author

Indeed, this deserves an entry in the changelog! Actually there are 2 more classes that should implement ArrayAccess (see php-ds/ext-ds#163), so I'll finish this PR once the related PR gets approved.

In the meantime, could you please point me to where I can learn how to compile the PHP docs to HTML? I'm new to the XML format in use, and would like to be able to test my changes locally.

@cmb69
Copy link
Member

cmb69 commented Oct 23, 2020

See the "Build the documentation" section at http://doc.php.net/tutorial/local-setup.php.

@BenMorel
Copy link
Contributor Author

Thank you, @cmb69! All done now, ready for review.

But please wait for @rtheunissen's feedback on php-ds/ext-ds#163 before considering merging!

</thead>
<tbody>
<row>
<entry>1.3.0</entry>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<entry>1.3.0</entry>
<entry>PECL ds 1.3.0</entry>

Otherwise we get confusing version info on https://www.php.net/manual/en/doc.changelog.php.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry about that. I did think that this might bring confusion, but saw other extensions doing the same so thought that was the norm:

<entry>1.3.0</entry>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fcc6727.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, the manual is pretty inconsistent in this regard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can write a quick script to identify these and fix them, if you wish.

(Basically, looking for any <entry> version < 4.x which would mean that we're not talking about a PHP version, as this manual does not have any changelog for PHP < 4.x, if I'm not mistaken. That would maybe not flag all of them, but most of them).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that would be very nice! :)

@rtheunissen
Copy link
Contributor

I have merged the array access changes, which will be released soon alongside a few other fixes on 1.3.0

@BenMorel
Copy link
Contributor Author

@rtheunissen Thanks for your responsiveness! 👍

@cmb69 Ready to merge then!

@cmb69
Copy link
Member

cmb69 commented Oct 24, 2020

@cmb69 cmb69 closed this Oct 24, 2020
@BenMorel
Copy link
Contributor Author

Thank you! Is there still a work in progress to move the repo to Git?

@cmb69
Copy link
Member

cmb69 commented Oct 24, 2020

Unfortunately, that migration has stalled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants