Demo\Example\ErrorDemo::notSoGoodMethod PHP Method

notSoGoodMethod() public method

Method that is very tricky and should generate a notice
public notSoGoodMethod ( )
    public function notSoGoodMethod()
    {
        $value = round(microtime(true)) % 3;
        // Sometimes this equal to 0
        return rand(1, 10) / $value;
    }

Usage Example

Beispiel #1
0
        echo "I should work to earn some money", PHP_EOL;
        $example->work();
        echo "It was a nice day, go to bed", PHP_EOL;
        $example->sleep();
        break;
    case 'dynamic-traits':
        $aspectName = 'Demo\\Aspect\\IntroductionAspect';
        $example = new IntroductionDemo();
        // Original class doesn't implement Serializable
        $example->testSerializable();
        break;
    case 'declare-errors':
        $aspectName = 'Demo\\Aspect\\DeclareErrorAspect';
        $example = new ErrorDemo();
        $example->oldMethod();
        $example->notSoGoodMethod();
        break;
    default:
}
?>
  </pre></div>
  <div class="panel-group" id="accordion">
<?php 
// Conditional block with source code of aspect
if ($aspectName) {
    ?>

    <div class="panel panel-default" id="aspect">
      <div class="panel-heading">
          <a data-toggle="collapse" href="#collapseOne">
              Source code of aspect