granam/strict-object 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

granam/strict-object

最新稳定版本:3.1.0

Composer 安装命令:

composer require granam/strict-object

包简介

Base object, checking access to undefined properties and methods

README 文档

README

Build Status

A base object, throwing an exception in case of access to undefined property or method.

  1. You deserve to know...
  2. Usage
  3. Install

You deserve to know...

Be lazy. Be smart.

To achieve that, you need to know.

Know about access to an undefined property, to an undefined method.

It can be anything, but at first it is a problem.

And you should be lazy enough to want to know that happened immediately, rather than searching logs after.

Usage

Just extend the object...

use Granam\StrictObject\StrictObject;

class Foo extends StrictObject {

    public $everythingOk = true;
    // body
}

...and your code then immediately stops on mistakes like

// test.php
$foo = new Foo();

if (!$foo->everythinkOk) {
    // Did you noticed the typo? Maybe not, but StrictObject will!
}

...which results into PHP Fatal error: Uncaught exception 'ReadingAccess' on line 4 in file test.php Think twice about catching something like that! Remember, you need to know...

Install

composer require granam/strict-object

统计信息

  • 总下载量: 50.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 35
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-29