Commit b0651d95 authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Rename package

parent 60d63d6e
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
# PHP Private Access

[![Packagist](https://img.shields.io/packagist/v/sandfoxme/private-access.svg?style=flat-square)](https://packagist.org/packages/sandfoxme/private-access)
[![License](https://img.shields.io/packagist/l/sandfoxme/private-access.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Packagist](https://img.shields.io/packagist/v/arokettu/private-access.svg?style=flat-square)](https://packagist.org/packages/arokettu/private-access)
[![License](https://img.shields.io/packagist/l/arokettu/private-access.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Gitlab pipeline status](https://img.shields.io/gitlab/pipeline/sandfox/php-private-access/master.svg?style=flat-square)](https://gitlab.com/sandfox/php-private-access/-/pipelines)

A small simple library to access private properties of the objects.
@@ -12,7 +12,7 @@ No Reflection API calls!

Use composer:

    composer require sandfoxme/private-access --dev
    composer require arokettu/private-access --dev

## Usage

+2 −2
Original line number Diff line number Diff line
{
    "name": "sandfoxme/private-access",
    "name": "arokettu/private-access",
    "description": "Simple and fast methods to read private properties and call private methods",
    "keywords": ["debug", "dev"],
    "homepage": "https://sandfox.dev/php/private-access.html",
@@ -31,7 +31,7 @@
    },
    "autoload-dev": {
        "psr-4": {
            "Sandfox\\Debug\\PrivateAccess\\Tests\\": "tests"
            "Arokettu\\Debug\\PrivateAccess\\Tests\\": "tests"
        }
    },
    "require": {
+7 −7
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ Use composer:

.. code-block:: bash

    composer require sandfoxme/private-access --dev
    composer require arokettu/private-access --dev

Why ``--dev``?
--------------
@@ -61,7 +61,7 @@ Get value of a private field

    <?php

    use function SandFox\Debug\get_private_field;
    use function Arokettu\Debug\get_private_field;

    get_private_field($a, 'secret'); // get $a->A::secret value
    get_private_field(A::class, 'staticSecret'); // get A::$staticSecret value
@@ -76,7 +76,7 @@ Set value of a private field

    <?php

    use function SandFox\Debug\set_private_field;
    use function Arokettu\Debug\set_private_field;

    set_private_field($a, 'secret', 'new secret'); // set new $a->A::secret value
    set_private_field(A::class, 'staticSecret', 'new secret'); // set new A::$staticSecret value
@@ -91,7 +91,7 @@ Call private method

    <?php

    use function SandFox\Debug\call_private_method;
    use function Arokettu\Debug\call_private_method;

    call_private_method($a, 'doStuff', 'whatever'); // call $a->A::doStuff('whatever')
    call_private_method(A::class, 'doStaticStuff', 'whatever'); // call A::doStaticStuff('whatever')
@@ -110,7 +110,7 @@ Get value of a private constant

    <?php

    use function SandFox\Debug\get_private_const;
    use function Arokettu\Debug\get_private_const;

    get_private_const($a, 'SECRET_CONST');
    // or
@@ -125,8 +125,8 @@ The library is available as open source under the terms of the `MIT License`_.
.. _PsySH:          https://psysh.org/
.. _MIT License:    https://opensource.org/licenses/MIT

.. |Packagist|  image:: https://img.shields.io/packagist/v/sandfoxme/private-access.svg?style=flat-square
   :target:     https://packagist.org/packages/sandfoxme/private-access
.. |Packagist|  image:: https://img.shields.io/packagist/v/arokettu/private-access.svg?style=flat-square
   :target:     https://packagist.org/packages/arokettu/private-access
.. |GitHub|     image:: https://img.shields.io/badge/get%20on-GitHub-informational.svg?style=flat-square&logo=github
   :target:     https://github.com/arokettu/php-private-access
.. |GitLab|     image:: https://img.shields.io/badge/get%20on-GitLab-informational.svg?style=flat-square&logo=gitlab
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
 * @license     https://opensource.org/licenses/MIT MIT License
 */

namespace SandFox\Debug;
namespace Arokettu\Debug;

/**
 * @param object|string|array $object Object or class name or [object, className]
+5 −5
Original line number Diff line number Diff line
<?php

namespace Sandfox\Debug\PrivateAccess\Tests;
namespace Arokettu\Debug\PrivateAccess\Tests;

use ClassWithPrivateConstant;
use ClassWithPrivateData;
use PHPUnit\Framework\TestCase;

use function SandFox\Debug\call_private_method;
use function SandFox\Debug\get_private_const;
use function SandFox\Debug\get_private_field;
use function SandFox\Debug\set_private_field;
use function Arokettu\Debug\call_private_method;
use function Arokettu\Debug\get_private_const;
use function Arokettu\Debug\get_private_field;
use function Arokettu\Debug\set_private_field;

class PrivateAccessTest extends TestCase
{