init
This commit is contained in:
+121
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Magento\Framework\Interception\Fixture;
|
||||
|
||||
/**
|
||||
* phpcs:ignoreFile
|
||||
*/
|
||||
class Intercepted extends InterceptedParent implements InterceptedInterface
|
||||
{
|
||||
protected $_key;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function A($param1)
|
||||
{
|
||||
$this->_key = $param1;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function B($param1, $param2)
|
||||
{
|
||||
return '<B>' . $param1 . $param2 . $this->C($param1) . '</B>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function C($param1)
|
||||
{
|
||||
return '<C>' . $param1 . '</C>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function D($param1)
|
||||
{
|
||||
return '<D>' . $this->_key . $param1 . '</D>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
final public function E($param1)
|
||||
{
|
||||
return '<E>' . $this->_key . $param1 . '</E>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function F($param1)
|
||||
{
|
||||
return '<F>' . $param1 . '</F>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function G($param1)
|
||||
{
|
||||
return '<G>' . $param1 . "</G>";
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function K($param1)
|
||||
{
|
||||
return '<K>' . $param1 . '</K>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function V($param1)
|
||||
{
|
||||
return '<V>' . $param1 . '</V>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function W($param1)
|
||||
{
|
||||
return '<W>' . $param1 . '</W>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function X($param1)
|
||||
{
|
||||
return '<X>' . $param1 . '</X>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function Y($param1)
|
||||
{
|
||||
return '<Y>' . $param1 . '</Y>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function Z($param1)
|
||||
{
|
||||
return '<Z>' . $param1 . '</Z>';
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Framework\Interception\Fixture\Intercepted;
|
||||
|
||||
use Magento\Framework\Interception\Fixture\Intercepted;
|
||||
|
||||
class FirstPlugin
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $_counter = 0;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundC(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<F:C>' . $next($param1) . '</F:C>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundD(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
$this->_counter++;
|
||||
return '<F:D>' . $this->_counter . ': ' . $next($param1) . '</F:D>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundK(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
$result = $subject->C($param1);
|
||||
return '<F:K>' . $subject->F($result) . '</F:K>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeG(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<F:bG>' . $param1 . '</F:bG>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundG(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return $next('<F:G>' . $param1 . '</F:G>');
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterG(Intercepted $subject, $result)
|
||||
{
|
||||
return '<F:aG>' . $result . '</F:aG>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeV(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<F:bV/>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundV(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<F:V>' . $param1 . '<F:V/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeW(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<F:bW/>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundW(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<F:W>' . $param1 . '<F:W/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterW(Intercepted $subject, $result)
|
||||
{
|
||||
return '<F:aW/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeX(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<F:bX/>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundY(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<F:Y>' . $param1 . '<F:Y/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterZ(Intercepted $subject, $result)
|
||||
{
|
||||
return '<F:aZ/>';
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Framework\Interception\Fixture\Intercepted;
|
||||
|
||||
use Magento\Framework\Interception\Fixture\InterceptedInterface;
|
||||
|
||||
class InterfacePlugin
|
||||
{
|
||||
/**
|
||||
* @param InterceptedInterface $subject
|
||||
* @param \Closure $next
|
||||
* @param string $param1
|
||||
* @return string
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundC(InterceptedInterface $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<IP:C>' . $next($param1) . '</IP:C>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param InterceptedInterface $subject
|
||||
* @param \Closure $next
|
||||
* @param $param1
|
||||
* @return string
|
||||
*/
|
||||
public function aroundF(InterceptedInterface $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<IP:F>' . $subject->D($next($subject->C($param1))) . '</IP:F>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeG(InterceptedInterface $subject, $param1)
|
||||
{
|
||||
return ['<IP:bG>' . $param1 . '</IP:bG>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundG(InterceptedInterface $subject, \Closure $next, $param1)
|
||||
{
|
||||
return $next('<IP:G>' . $param1 . '</IP:G>');
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterG(InterceptedInterface $subject, $result)
|
||||
{
|
||||
return '<IP:aG>' . $result . '</IP:aG>';
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Framework\Interception\Fixture\Intercepted;
|
||||
|
||||
use Magento\Framework\Interception\Fixture\Intercepted;
|
||||
|
||||
class Plugin
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $_counter = 0;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundC(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<P:C>' . $next($param1) . '</P:C>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundD(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
$this->_counter++;
|
||||
return '<P:D>' . $this->_counter . ': ' . $next($param1) . '</P:D>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundK(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
$result = $subject->C($param1);
|
||||
return '<P:K>' . $subject->F($result) . '</P:K>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeG(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<P:bG>' . $param1 . '</P:bG>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundG(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return $next('<P:G>' . $param1 . '</P:G>');
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterG(Intercepted $subject, $result)
|
||||
{
|
||||
return '<P:aG>' . $result . '</P:aG>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeV(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<P:bV/>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundV(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<P:V>' . $param1 . '<P:V/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeW(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<P:bW/>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundW(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<P:W>' . $param1 . '<P:W/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterW(Intercepted $subject, $result)
|
||||
{
|
||||
return '<P:aW/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function beforeX(Intercepted $subject, $param1)
|
||||
{
|
||||
return ['<P:bX/>'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function aroundY(Intercepted $subject, \Closure $next, $param1)
|
||||
{
|
||||
return '<P:Y>' . $param1 . '<P:Y/>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterZ(Intercepted $subject, $result)
|
||||
{
|
||||
return '<P:aZ/>';
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Magento\Framework\Interception\Fixture;
|
||||
|
||||
/**
|
||||
* @codingStandardsIgnoreStart
|
||||
*/
|
||||
interface InterceptedInterface
|
||||
{
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function C($param1);
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function F($param1);
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Magento\Framework\Interception\Fixture;
|
||||
|
||||
/**
|
||||
* @codingStandardsIgnoreStart
|
||||
*/
|
||||
class InterceptedParent implements InterceptedParentInterface
|
||||
{
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function A($param1)
|
||||
{
|
||||
return 'A' . $param1 . 'A';
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*/
|
||||
public function B($param1, $param2)
|
||||
{
|
||||
return $param1 . $param2 . $this->A($param1);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Magento\Framework\Interception\Fixture;
|
||||
|
||||
interface InterceptedParentInterface
|
||||
{
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
* @codingStandardsIgnoreStart
|
||||
*/
|
||||
public function A($param1);
|
||||
}
|
||||
Reference in New Issue
Block a user