Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • Symfony\Component\Yaml\Tests\A
  • Symfony\Component\Yaml\Tests\B
  • Symfony\Component\Yaml\Tests\DumperTest
  • Symfony\Component\Yaml\Tests\InlineTest
  • Symfony\Component\Yaml\Tests\ParseExceptionTest
  • Symfony\Component\Yaml\Tests\ParserTest
  • Symfony\Component\Yaml\Tests\YamlTest
  • Overview
  • Namespace
  • Function
  • Tree
 1: <?php
 2: 
 3: namespace Mockery\Generator\StringManipulation\Pass;
 4: 
 5: use Mockery\Generator\MockConfiguration;
 6: 
 7: /**
 8:  * Internal classes can not be instantiated with the newInstanceWithoutArgs 
 9:  * reflection method, so need the serialization hack. If the class also 
10:  * implements Serializable, we need to replace the standard unserialize method 
11:  * definition with a dummy
12:  */
13: class RemoveUnserializeForInternalSerializableClassesPass 
14: {
15:     const DUMMY_METHOD_DEFINITION = 'public function unserialize($string) {} ';
16: 
17:     public function apply($code, MockConfiguration $config)
18:     {
19:         $target = $config->getTargetClass();
20: 
21:         if (!$target) {
22:             return $code;
23:         }
24: 
25:         if (!$target->hasInternalAncestor() || !$target->implementsInterface("Serializable")) {
26:             return $code;
27:         }
28: 
29:         $code = $this->appendToClass($code, self::DUMMY_METHOD_DEFINITION);
30: 
31:         return $code;
32:     }
33: 
34:     protected function appendToClass($class, $code)
35:     {
36:         $lastBrace = strrpos($class, "}");
37:         $class = substr($class, 0, $lastBrace) . $code . "\n    }\n";
38:         return $class;
39:     }
40: }
41: 
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen