2017 © Pedro Peláez
 

library scope-guard

php-timecop helper using Scope Guard pattern

image

timecop/scope-guard

php-timecop helper using Scope Guard pattern

  • Wednesday, April 20, 2016
  • by zonuexe
  • Repository
  • 1 Watchers
  • 2 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Timecop Scope Guard

, (*1)

DESCRIPTION

hnw/php-timecop helper using Scope Guard pattern., (*2)

INSTALL

Require hnw/php-timecop extension., (*3)

cd /path/to/your-project
composer require --dev timecop/scope-guard

USAGE

<?php

public function test_foo()
{
    // Don't remove $t
    $t = new \TimeFreezeScopeGuard('2007-08-31 12:00:00');

    echo date('Y-m-d H:i:s');
    // 2007-08-31 12:00:00
}

Even if it was warned that $t is an unused variable, please do not remove it., (*4)

When test_foo() method has completed, $t variable is deleted by GC, timecop is turn off., (*5)

LICENSE

Copyright 2015 pixiv Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

The Versions

20/04 2016

dev-master

9999999-dev

php-timecop helper using Scope Guard pattern

  Sources   Download

Apache-2.0

The Requires

  • ext-timecop *

 

testing datetime

25/11 2015

dev-develop

dev-develop

php-timecop helper using Scope Guard pattern

  Sources   Download

Apache-2.0

The Requires

  • ext-timecop *

 

testing datetime

25/11 2015

1.0.1

1.0.1.0

php-timecop helper using Scope Guard pattern

  Sources   Download

Apache-2.0

The Requires

  • ext-timecop *

 

testing datetime

24/11 2015

1.0.0

1.0.0.0

php-timecop helper using Scope Guard pattern

  Sources   Download

Apache-2.0

The Requires

  • ext-timecop >= 1.0.5

 

testing datetime