2.0: Refactoring app build #230

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
2 participants
@basuke
Contributor

basuke commented Oct 7, 2011

App::build looks a little bit complex. Clean it up to make the intent clearer.

  • App::build with RESET can do its work without others, so separate it in the beginning.
  • App::$_packageFormats was initialized in the method, but this method is also used in other place. Also initializing the huge array in the regular method looks like not polite way.
  • Legacy type conversion was held in two places, but this conversion is vital, so I move that in the beginning, do it only once.
  • I'm not sure there are historical reason, but App::build was declared as void return. In case with App::RESET, it returns $paths. I think it's a bug, so I've removed that. I can not find any usage of this pattern in the codebase.

Yosuke Basuke Suzuki and others added some commits Oct 6, 2011

Refactoring. change the order of code block for readability and bette…
…r granularity.

There's no dependency with the work for mode = App::RESET and the rest. Do first things first.
Bugfix. App:build() returns void.
Following the @return Doc, App::build() returns void. Removed.
Also there's no place to use this return value in the Cake's codebase.
@basuke

This comment has been minimized.

Show comment Hide comment
@basuke

basuke Oct 7, 2011

Contributor
Welcome to CakePHP v2.0.0-RC3 Console
---------------------------------------------------------------
App : app
Path: /Users/basuke/work/cakephp/app/
---------------------------------------------------------------
CakePHP Test Shell
---------------------------------------------------------------
PHPUnit 3.5.15 by Sebastian Bergmann.

.......................

Time: 0 seconds, Memory: 17.25Mb

OK (23 tests, 160 assertions)
Contributor

basuke commented Oct 7, 2011

Welcome to CakePHP v2.0.0-RC3 Console
---------------------------------------------------------------
App : app
Path: /Users/basuke/work/cakephp/app/
---------------------------------------------------------------
CakePHP Test Shell
---------------------------------------------------------------
PHPUnit 3.5.15 by Sebastian Bergmann.

.......................

Time: 0 seconds, Memory: 17.25Mb

OK (23 tests, 160 assertions)
@lorenzo

This comment has been minimized.

Show comment Hide comment
@lorenzo

lorenzo Oct 14, 2011

Owner

Thanks a lot! landed in [0b6c93c]

Owner

lorenzo commented Oct 14, 2011

Thanks a lot! landed in [0b6c93c]

@lorenzo lorenzo closed this Oct 14, 2011

tPl0ch pushed a commit to tPl0ch/cakephp that referenced this pull request Feb 5, 2012

tPl0ch pushed a commit to tPl0ch/cakephp that referenced this pull request Feb 7, 2012

Thomas Ploch
Added support for simplified required validation on 'create' or 'upda…
…te'. Added testcases for new 'required' attributes and conflicts with the 'on' key. Fixes #230.

ceeram pushed a commit to ceeram/cakephp that referenced this pull request Feb 22, 2012

Merge pull request #467 from tPl0ch/2.1-required-update-create
Added support for simplified required validation on 'create' or 'update'. Fixes #230.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment