Code Monkey home page Code Monkey logo

class-kernel's People

Contributors

chajr avatar

Watchers

 avatar  avatar

class-kernel's Issues

create recurent data functions

create functions to create objects from associative data

  • associative array
  • associative json
  • associative stdClass
  • associative xml
  • associative serialized

method naming changes

change name of some methods to remove prefix used to handle data by magic methods

Add is magic method

Will compare given value with existing in object using is prefix with === checking

$object->isSomeData(false);

will return true if some_data key is false

optionalu not keyword

getData with null key

If _DATA will have key with null value then getData will return value of that key, istead of all data from object. Null key must not be handled!

if (!$key) {
    $data = $this->_DATA;
 }
if (isset($this->_DATA[$key])) {
    $data = $this->_DATA[$key];
}

If key is null then dont check that key exist in _DATA array

*Data methods rebuild

In future data will be normal key inside of object. All methods with *Data must be marked as deprecated and constructor must not use array detection by data key.

  • Replace getData by toArray
  • Replace setData by appendArray
  • change data key in constructor

set data with check

when we set data class should check that data exists on the same key. If it exist check that data is the same as we want to set. When data is the same we don't change object status to modiefied

fix delete collection element

fix delete collection element with original data
after deleting some element form collection can be problems with restore it from original collection

Dependency injection

Split Object parts to diffetent classes and allow to load their different versions by Dependency Injection (Zend)

Set data validation

upgrade data validation to be more generic.

  • is boolean with check data type (true, false, null)
  • is object with object type
  • give validation function/method or closure (is_callable)
  • with rules given in data comparation

Documentation change

  • move all documentation to wiki, into doc md files only link to documentation
  • in phpdoc change return description to $this when method return self

add unit tests

  • BlueObject basic functionalities
  • original data tests
  • object creation with all types
  • export object to all types
  • data preparation, validation ad return
  • test array functionalities
  • test other methods
  • data comparation
  • traveler
  • merge two objects

object creation fix

After creating object with data, dataChanged will always return true. Also new keys will be added to list.

Apply validation to arrays

when validator detect that data to validate is an array will apply validation rule to all elements in array (recursively)

Array merge with intiger key replacement

Create new class called Helper with some usefull functions.
First function will be method to merge arrays with replacement data in intiger keys (that will resolve problem with merging modified arrays in Collection class)

_setClassCounter undefined index

if class instance dosn't exists we get Undefined index error.
Solution:

if (!isset(self::$_classCounter[$class])) {
    self::$_classCounter[$class] = 0;
}

validation and data changes flag

Create flags to quick enable/disable data validation and change on input, output.
Methods to handle:

  • turnValidationOn
  • turnValidationOff
    etc.

add sorting and filtering methods to collection

    public function setFilter() { }
    public function getFilters(){ }
    public function resetFilters() { }
    public function setOrder() { }
    public function getOrder() { }
    public function resetOrder() { }

Insert different data after creation

After object is created, add methods to insert data in json, xml, serialized string by special methods.
appendJson, appendSerialized, appendXml, appendStd

Finish BlueObject class

compareData:

  • modify to compare own data with other object data
  • key is string, list of keys or null(compare all keys)
  • replace key with dataToCheck

Xml object refactor

some refactor changes for method

  • return $this statement
  • return as string method

data preparation

Allow to lunch method/function on data before set in $_DATA array. BlueObject library will have special list (protected $_dataPreparationCallbacks = [];) with name of key and name of method/function to lunch before data set.

Also add another method to validate data before set in $_DATA. Wiil work as the same way as above, but as default will be turned off.

Make after #11 issue

For now to emulatethat functionalities use _putData method rewrite

Data preparation in __constructor

apply data preparation for methods _appendArray, _appendStdClass, _appendSerialized, _appendJson, _appendXml and _appendSimpleXml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.