Arr::get docs fix #246

Closed
wants to merge 281 commits into
from

Conversation

Projects
None yet
Contributor

hkdobrev commented Apr 27, 2012

The previous version of the PHPDoc for the Arr::get method was not accurate. It said you are retrieving a key, when you are actually retrieving a value for a key.

Contributor

ThePixelDeveloper commented on 701fcca Sep 25, 2011

Cool story, bro. You're committing to Kohana which isn't agile :-)

Why javascript notation (else if) instead of PHP's one (elseif)?

Contributor

samsoir replied Sep 27, 2011

It should be elseif

samsoir and others added some commits Sep 27, 2011

@samsoir samsoir No story, fixing CS violation in elseif statement c3c4f6a
@samsoir samsoir No story, fixing CS violation in elseif statement 778550d
le6o return early fa44e96
@samsoir samsoir Merge pull request #163 from kiddivouchers/issue/4276
Fixes #4276, illegal offset error now fixed.
6754e40
@samsoir samsoir Fixes #4276, illegal offset error is now fixed aa64b97
@samsoir samsoir Refs #3536, tidyed up redundent parameters not required in 3.2 reques…
…t client internal execution
d8a36f6
@acoulton acoulton Fix bug introduced by 5b8159f fixing Arr::map callback syntax - fixes…
… #4259
7ec1d82
Jordan Thomas Add additional irregular pluralizations to inflector config. Remove e…
…ntries handled by inflector logic. Addresses #4322.

Adds:
- appendix
- cactus
- calf
- crisis
- criterion
- curriculum
- diagnosis
- elf
- ellipsis
- foot
- hoof
- hypothesis
- knife
- life
- loaf
- nucleus
- oasis
- octopus
- paralysis
- parenthesis
- phenomenon
- potato
- quiz
- radius
- scarf
- stimulus
- syllabus
- synthesis
- thief
- tooth
- wharf
- wife

Removes:
- clothes
- course
- expense
- movie
- purchase
- size
- verse
f2a83a1
@cbandy cbandy More Arr::merge() tests bc5102c
@cbandy cbandy Handle indexed arrays consistently in Arr::merge(). Fixes #3141 22e96d3
Spider Fixed bug with incorrect mime type 3bc535e
@shadowhand shadowhand Check the type of $message in Validation::errors() to prevent issues …
…when a field name and rule are the same, fixes #4365
fe38fe9
@shadowhand shadowhand Merge pull request #183 from stillman/3.2/develop
Send the correct mime type when sending files, fixes #4344
e6ed617
@shadowhand shadowhand Merge pull request #186 from shadowhand/3.2/issue/4365-validation-mes…
…sage-type-checking

Check message type in Validation::errors(), fixes #4365
cbd340b
@kiall kiall Add a action execution wrapper. Refs #4271 72258b7
@kiall kiall Update action wrapper per feedback. Refs #4271 6b7ae2a
@kiall kiall Merge pull request #188 from kohana/3.3/feature/4271-ActionWrapper
Merge pull request for #4271
dc43fd3
@kiall kiall Fixes #3178 - "Kohana Exception's hide $previous".
First PHP 5.2 compatibility break.
e36c698
@kiall kiall Merge pull request #177 from jordanthomas/3.1/develop
Add additional irregular pluralizations to inflector config
a0b6348
@kiall Jordan Thomas Add additional irregular pluralizations to inflector config. Remove e…
…ntries handled by inflector logic. Addresses #4322.

Adds:
- appendix
- cactus
- calf
- crisis
- criterion
- curriculum
- diagnosis
- elf
- ellipsis
- foot
- hoof
- hypothesis
- knife
- life
- loaf
- nucleus
- oasis
- octopus
- paralysis
- parenthesis
- phenomenon
- potato
- quiz
- radius
- scarf
- stimulus
- syllabus
- synthesis
- thief
- tooth
- wharf
- wife

Removes:
- clothes
- course
- expense
- movie
- purchase
- size
- verse
03a4af5
@kiall Jordan Thomas Add additional irregular pluralizations to inflector config. Remove e…
…ntries handled by inflector logic. Addresses #4322.

Adds:
- appendix
- cactus
- calf
- crisis
- criterion
- curriculum
- diagnosis
- elf
- ellipsis
- foot
- hoof
- hypothesis
- knife
- life
- loaf
- nucleus
- oasis
- octopus
- paralysis
- parenthesis
- phenomenon
- potato
- quiz
- radius
- scarf
- stimulus
- syllabus
- synthesis
- thief
- tooth
- wharf
- wife

Removes:
- clothes
- course
- expense
- movie
- purchase
- size
- verse
eedefa1
@kiall Zbigniew Motyka Converting method Arr::extract to work with paths not keys. Fixes #4371 cad88a9
@kiall kiall Add tests for Arr::extract() via paths. Tests #4371. 72567e2
@kiall kiall Merge pull request #189 from kohana/3.3/feature/4371-extract-paths
Fixes #4371 - Merge "Arr::extract() with paths"
a94e45d
@kiall Jonathan Cremin Fixes #4291, checks for PHP 5.4 before doing get_magic_quotes_gpc as …
…it has been deprecated.
acf8ff0
@kiall Jonathan Cremin Fixes #4291, checks for PHP 5.4 before doing get_magic_quotes_gpc as …
…it has been deprecated.
c17dab7
@AlexC @kiall AlexC Changed usage of $_POST to Request::post() in guide documentation. Fi…
…xes #4256.
42f5b7e
@kiall kiall Merge branch '3.2/develop' into 3.3/develop 2c89783
@kiall kiall Refs #4374 / Refs #4373 - Return a Response from Controllers and Clea…
…nup Request Isolation / Exception Handling.
669f385
Contributor

samsoir commented on classes/kohana/http.php in 669f385 Dec 30, 2011

a return value isn't really required, but won't hurt I guess

Contributor

kiall replied Dec 30, 2011

Agreed, Its not strictly necessary but does no harm..

kiall and others added some commits Dec 30, 2011

@kiall kiall Refactor Exception -> View conversion and reinstate correct exception…
… handling for sub requests. Refs #4373
0b7471a
@kiall kiall Remove stray debugging output. f5481e7
@kiall kiall Fixup exception handling from outside the initial Request_Client_Inte…
…rnal::execute() invocation. Refs #4373
b9b6f7d
@kiall kiall Fixup HTTP_Cache. Refs #4374. 03b569a
@kiall kiall Move Response::check_cache() to HTTP class. Refs #4373. 5b9bd8e
@kiall kiall Introduce the notion of `HTTP_Exception_Expected` and `HTTP_Exception…
…::get_response()`. Refs #4377.
1440b6a
@kiall kiall General cleanup of the Kohana_Exception class. Refs #4377. a6ee21a
@kiall kiall Add HTTP_Exception_Redirect to house common code for redirections. Re…
…fs #4377
f2eca6f
@kiall kiall First stab at documentation for #4373, #4374, #4375 and #4377.
Refs #4373 / Refs #4374 / Refs #4375 / Refs #4377
dca0a3c
@kiall kiall Fixup some bugs in the previous commits + Add a HTTP_Exception::reque…
…st() method.
fd8e3af
@kiall kiall Add class-level docblock to HTTP_Exception_Expected and HTTP_Exceptio…
…n_Redirect. Refs #4377 and #4375.
cc0beff
@kiall kiall Expand on docs for custom error pages. Refs #4377. 76d51af
@kiall kiall Update occurrences of 3.2 in the docs to 3.3. b9c5737
@kiall kiall Removed unused variable "Kohana::$log_errors" 9743e42
@kiall kiall Merge remote-tracking branch 'origin/3.3/develop' into 3.3/feature/Re…
…questResponseCleanup
15824ce
@kiall kiall Fix environment comparison operator in docs. Refs #4377. 15329a3
@kiall kiall Use XDebug to provide stack traces for fatal errors if available. Fix…
…es #4020.
f86c9b8
@kiall kiall Enable XDebug parameter collection in development. Refs #4020. 0397372
@kiall kiall Merge pull request #160 from acoulton/bug/4259-syntax-for-arr-map
Clarify syntax for passing array callbacks to Arr::map. Fixes #4259.
814b2b8
@acoulton @kiall acoulton Clarify syntax for passing array callbacks to Arr::map - fixes #4259 f3e64d0
@acoulton @kiall acoulton Fix bug introduced by 5b8159f fixing Arr::map callback syntax - fixes…
… #4259
a7b5ba4
@kiall kiall Merge pull request #146 from mintbridge/patch-1
Fixing typo in Doc block for Valid::alpha_numeric() Test
881a979
@mintbridge @kiall mintbridge Fixing typo in Doc block for Valid::alpha_numeric() Test 02542a7
@Ikke Ikke Arr::get() uses array_key_exists now in stead of isset. Fixes #4012 76f6e4c
@Ikke Ikke Change arr::get so that it fixes #4012 and still work with ArrayAccess
ArrayObjects with STD_PROP_LIST don't work together with
array_key_exists. These tests test if arr::get still works with
ArrayObjects.

arr::get now additional checks if the array is an ArrayAccess object and
uses the offsetExists() method to check if the key exists.
0128655
@Ikke Ikke Fix tab/space problem 1041448
@Ikke Ikke Add missing argument in example for Upload::Image() 12f2742
@shadowhand shadowhand Merge pull request #191 from Ikke/3.3/fix-4297
3.3/fix 4297
c518ba3
@parshap @shadowhand parshap Decouple session data serialization 43804ad
@shadowhand shadowhand Merge pull request #94 from simshaun/3.2/develop
3.2/develop
193deb0
@zombor zombor Remove all instances of `cli` from kohana-core, Refs #3989 85c00aa
@kiall kiall Remove reamining CLI test. Refs #3989 ddb166d
@kiall kiall Merge branch '3.3/develop' into 3.3/feature/RequestResponseCleanup c8c8c7f
@kiall kiall Remove tests that no longer apply. aa68cd6
@kiall kiall Remove calls to Request::create_response() from the tests. Refs #4374. 7af34d7
@kiall kiall Move HTTP_Cache class to the Cache module. Fixes #4382 18c7a89
@kiall kiall Merge branch '3.3/develop' into 3.3/feature/RequestResponseCleanup
Conflicts:
	classes/kohana/http/cache.php
	tests/kohana/request/client/CacheTest.php
1ea4fe2
@salathe @shadowhand salathe Make Date::formatted_time()'s timezone parameter work even if the inp…
…ut date/time string has a timezone, fixes #3902
09b8fc5
@shadowhand shadowhand Merge branch '3.2/develop' into 3.3/develop 111b069
@shadowhand shadowhand Merge pull request #190 from Ikke/3.3/fix-4012
Fixes #4012
7dc2a8e
@shadowhand shadowhand Added Route::filter(), callback support for route matching, refs #4388 af999fb
@shadowhand shadowhand Modified how filter return values are handled in Route::matches(), re…
…fs #4388
3b45789
@shadowhand shadowhand Added tests for Route::filter(), refs #4388 45937d6
@shadowhand shadowhand Merge pull request #196 from kohana/3.3/feature/4388-route-filters
Fixes #4388
a282ef1
Contributor

acoulton commented on 22e96d3 Jan 7, 2012

I think this makes sense, but it doesn't remove the need to change some indexed config arrays to associative - eg the memcached config that ships with the cache module - as otherwise there is no way to remove or update settings at module or system level.

Indexed arrays should only be used where a module or application developer would never need to remove a value from higher up the tree - which I think is a fairly limited use case anyway?

Contributor

shadowhand commented on 4eb6180 Feb 13, 2012

This is a perfect example of when CamelCase issues might pop up. I don't think there is a good solution for it, other than documentation.

should be if ( ! empty($params['controller']))

Contributor

shadowhand replied Feb 14, 2012

Agreed.

Member

kemo commented on c5c45ac Feb 16, 2012

finally, the ugliest line(s) in Kohana code :P

Contributor

kiall replied Feb 16, 2012

Agreed! But a cleaner diluting without a foreach wasn't forthcoming!

Contributor

kiall replied Feb 16, 2012

Solution* damn auto correct!

Contributor

shadowhand replied Feb 16, 2012

Wait, why is this still using if (array_key_exists(...))? It should be if (! empty(...)). There's no value in doing string operations on an empty string.

Contributor

kiall replied Feb 16, 2012

@shadowhand - ah yes. I completely forgot about that suggestion.

I won't be back at an actual computer until tomorrow, if you don't get to it beforehand I'll get it changed then.

Contributor

shadowhand replied Feb 17, 2012

@kiall Cleaned up in 5b8db1e to prevent the suggestion from being lost.

Kohana::$log instanceof Kohana_Log is much more accurate

Contributor

kiall replied Feb 25, 2012

Using Kohana::$log instanceof Kohana_Log would break some of the features of the CFS.

Kohana::$log instanceof Log is completely correct.

Contributor

Yahasana replied Feb 25, 2012

Please think about it twice. it doesn't break any thing but promises Kohana::$log is instance of Kohana_Log.

if someone drop a log.php in application/classes, which will break the Kohana system.

<?php
class Log {
    // foo
}
Contributor

kiall replied Feb 25, 2012

For a while during the 3.1 cycle - I had nearly exactly that.

class Config { 
   // My 100% replaced, but API compatible, config class.
}

That ability to do that is a feature of Kohana.

Contributor

Yahasana replied Feb 25, 2012

Oh, it's a good feature. however the customize class has to keep 100% API compatible as you do.
as I never try to 100% replaced Ko's classes, I miss this kind of feature. thanks

Kohana::$config instanceof Kohana_Config

Contributor

kiall replied Feb 25, 2012

As above..

Member

kemo commented on 26b90db Feb 25, 2012

shouldn't the total amount of characters include the length of end char?

Contributor

shadowhand replied Feb 25, 2012

It didn't before, I don't see a reason to change that.

Member

kemo replied Feb 25, 2012

@shadowhand I agree with that if this won't be merged into 3.2, otherwise 2 additional characters will brake things

Contributor

shadowhand replied Feb 25, 2012

This is only part of 3.3 and will not be merged into 3.2.

Member

Zeelot replied Feb 27, 2012

Did we really need to do this? Any font or IDE that cannot render an ellipsis, which is the only valid character here, needs to be thrown out the window.

Contributor

bobeagan replied Feb 27, 2012

Well … would have been preferable to the actual character, but I understand that you don't know how you will be rendering the output so three periods is fine by me.

Contributor

kiall replied Feb 27, 2012

Have to agree with @Zeelot here! … is the correct character to use! This should be reverted IMO

Also - I've often had graphic designers insist on &hellip; which I would now have to manually try and convert from 3 periods rather than letting htmlentities take care of it!

Contributor

shadowhand replied Feb 27, 2012

Where were you guys when the pull request was being discussed?! Reopen the ticket if you want to see this reverted.

Contributor

kiall replied Feb 27, 2012

Apologies :) Honestly, I saw the email for the original ticket and just assumed someone would reject it! Will re-open it for discussion now...

Shouldn't be Kohana_Exception?

Contributor

kiall replied Feb 29, 2012

Completely correct! Not sure how I managed that!

Thanks

shadowhand and others added some commits Mar 1, 2012

@shadowhand shadowhand Revert "Merge pull request #221 from thinkclay/3.3/develop"
This reverts commit 0055c46, reversing
changes made to c5c45ac.

refs #4450
13dd238
@kemo kemo Refs #4414: Add Facebook user agent to robots config a21882a
@kemo kemo Refs #4465: Response::generate_etag() is failing to check body 05ea261
@shadowhand shadowhand Merge pull request #228 from kemo/3.2/develop
fixes #4414, fixes #4465
01518e1
@shadowhand shadowhand Merge branch '3.2/develop' into 3.3/develop bab30d6
@shadowhand shadowhand Merge pull request #220 from deeceefar2/3.2/develop
fixed bug in Kohana::init() documentation
03c4cbd
@shadowhand shadowhand Merge branch '3.2/develop' into 3.3/develop ead576e
@shadowhand shadowhand Merge pull request #209 from AlexC/3.2/develop
Cleanup syslog, fixes #4284
0c47ecb
@shadowhand shadowhand Merge pull request #205 from awellis13/3.2/develop
IDE comment fix
12837cb
@shadowhand shadowhand Merge branch '3.2/develop' into 3.3/develop
Conflicts:
	classes/Kohana/Request.php
d8a6e9a
@acoulton acoulton Use property accessors rather than internal fields in Kohana_Request_…
…Client for extensibility [refs #4353]
58eda47
@kiall kiall Merge pull request #223 from acoulton/3.3/feature/4353-FollowRedirects
Refs #4353 - strict_redirect option and tests
a4ea876
@acoulton acoulton Resend request body when following redirects other than GET [refs #4353] 98451eb
@acoulton acoulton Refactor Kohana_Request_ClientTest for more powerful mocking [refs #4…
…353]

Implement a dummy controller and route to allow test cases to execute internal
requests and specify controller response through the URL. Provides more
flexibility than mocking the Request/Request_Client and allows for nested
requests.
90bc6d6
@acoulton acoulton Request_Client triggers callbacks on presence of specified headers [r…
…efs #4353]

Request_Client checks the server response and triggers user-definable callbacks
when specified headers are present. The existing logic for following redirects
is implemented as a callback - other uses would include for eg dealing with
a WWW-Authenticate header to refresh an OAuth token.

Callbacks can return a request (which will be executed with the same callbacks
and client parameters as the original request) or a response.
a8a1505
@acoulton acoulton Request callbacks are protected from too much recursion [refs #4353]
Request_Client takes a max_callback_depth property (default 5) and tracks
how many requests have been triggered by header callbacks - if the request
has too much recursion (eg an infinite redirect) the request is aborted with
a Request_Client_Recursion_Exception to allow this case to be handled by the
application developer.
ab62bf5
@acoulton acoulton Request_Client::callback_params() carries arbitrary data for header c…
…allbacks [refs #4353]

Request_Client::callback_params() provides a simple key-value store for
parameters that should be passed on to header callbacks. Parameter values
are copied into sub-requests triggered by a callback.
4e00844
@acoulton acoulton Document Request_Client header callbacks [refs #4353] 8ae2094
@acoulton acoulton Request_Client counts callback_depth from 1 for clarity [refs #4353]
callback_depth now begins at 1 (for the original request) rather than
zero. The property value is therefore directly equivalent to the number
of requests executed. For eg, after a standard request - redirect - request
pair, callback_depth will be equal to 2. The recursion limiting test case
has been updated to independently verify that the correct number of
requests were executed before the exception was thrown.
62335a6
@kiall kiall Strip out the first trace element from logged stacktrace. 1cc79c1
@kiall kiall Merge branch '3.3/develop' of http://github.com/kohana/core into 3.3/…
…develop
502e67e
@Zeelot Zeelot removing Route::$_callback as that is now handled by filters (refs #4…
…209, refs #4388)
0469530
Member

kemo commented on 7719279 Mar 7, 2012

I like the idea of passing a Route object to this method but dislike passing Route parameters through it. So:

$this->redirect(Route::get('foo'), 302);

or

$this->redirect($route);

should recognize that URI should be extracted from that route. IMHO passing route params shouldn't go through redirect() but by adding the uri() call to that route, which will return a valid string URI anyways (as it currently does):

$this->redirect(Route::get('foo')->uri(array('bar' => 'fubar')), 302);

The only "concern" I have about redirection is following internal URIs using the new request client: if 302 is returned on POST, will that new URI be POSTed to by default?

Edit:
On the second thought, URL::site() is the one that should be able to accept (internal) Route objects.

dyron commented on 747018e Mar 12, 2012

What's about type hinting public function __construct($uri, array $client_params = array(), .... or/and type casting $client_params = (array) $client_params?
If you expect an array, you should throw a warning instead of discarding it silently.
One the other hand since $client_params is passed to Request_Client_Internal it could handle the type juggling?

Member

Zeelot replied Mar 12, 2012

I think I agree (I initially didn't want to change what was written) but maybe it was done to allow NULL to get to the other params. I think I would like to simply do public function __construct($uri, array $client_params = NULL, .... and then remove the is_array() check for a simple (array) typecast.

Contributor

kiall replied Mar 12, 2012

I actually had the hint initially, but there was an issue with doing that..

Honestly - I'm struggling to remember exactly what that issue was, but it's there!

Member

Zeelot replied Mar 12, 2012

Ok I don't think it's a big deal. Since we are so close to the 3.3 release, I would rather leave this as is and take a look at cleaning it up afterwards.

this should be a "$return Request|HTTP_Exception", I think (returns $this->_request or $this)

phpguru and others added some commits Mar 20, 2012

@phpguru phpguru Wrote the encryption page of the docs using markdown 5e6b709
@kiall kiall Merge pull request #229 from acoulton/3.3/feature/4353-FollowRedirects
Fixes #4353 - Thanks @acoulton!
46b0662
@shadowhand shadowhand Merge pull request #232 from phpguru/5e6b709ad6d4cd263519cd1e4febc314…
…f14460e5

New Kohana 3.2 Guide page on Encryption, fixes #4480
743aebb
@shadowhand shadowhand Merge branch '3.2/develop' into 3.3/develop 232640b
@kemo kemo Refs #4375: redirect() parameter order 0a826ab
@kemo kemo Refs #4320 - Remove format parameter from Feed::create() fe4bfa4
@kemo @kiall kemo Refs #4375: redirect() parameter order a2a196f
@shadowhand shadowhand Merge pull request #233 from kemo/3.3/develop f15dd11
@kemo @kiall kemo Refs #4375: redirect() parameter order fc8ecf0
@kiall kiall Add test for HTTP::redirect(). Refs #4375. 0f149bc
@kiall kiall Merge branch '3.3/develop' of http://github.com/kohana/core into 3.3/…
…develop
0cdf52b
@kiall kiall Merge commit '0f149bcea7a3b099eb646d7d6a4be6f61e57ce65' into 3.3/develop 95fefc2
@kiall kiall Ensure HTTP_Redirect will only accept redirect HTTP codes. fa49803
@mintbridge @mintbridge mintbridge adding an explanation of PSR-0 support of file naming conventions, Re…
…fs #4001
7956a21
@zombor zombor Merge pull request #234 from mintbridge/3.3/feature/PSR-0-guide
Adding PSR-0 support to upgrading guide
1fa9368
@kemo kemo Refs #4236: Use Request client for XML requests e9fb6cc
@kiall kiall Fixes #4489 - Update to auto_load method to take a $directory parameter. 670e9af
@kiall kiall Merge pull request #235 from kemo/e9fb6cc3a2
Feed fixes. Fixes #4320 and #4236.
c0b0289
@kiall kiall Merge pull request #129 from czukowski/bug/4019-injected-routes-are-n…
…ot-taken-into-account

#4019: Injected routes are not taken into account for initial request
7c7c21b
@kiall kiall Merge branch '3.1/develop' into 3.2/develop d3a637a
@kiall kiall Merge branch '3.2/develop' into 3.3/develop 751e283
@thinkclay thinkclay Fixing formatting inconsistencies 6201090
@kiall kiall Merge pull request #237 from arraecreative/3.3/develop
Fixing formatting inconsistencies
6e66190
dpde Fixed a little misspelling 33b6425
@kiall kiall Merge pull request #241 from dpde/3.3/develop
Fixed a misspelling in the upgrade guide
8b75004
@mintbridge mintbridge fixing typo in email validation message 7fd6288
@kiall kiall Merge pull request #242 from mintbridge/patch-1
Fixing typo in email validation message
6b5de06
@randomecho randomecho capital kohana in text; fixing possessive typo; need comma before exa…
…mple
7f66ff5
@shadowhand shadowhand Merge pull request #243 from randomecho/3.3/develop
Docs update: Configuration in core/system guide
ab33556
@randomecho randomecho casing and possession of abbreviations; grammar and tense 6fb20de
@shadowhand shadowhand Merge pull request #244 from randomecho/3.3/develop
Docs edit: Bootstrap & Upgrading core/system guides
8b8a4ba
@hkdobrev hkdobrev Slightly more accurate PHPDoc for Arr::get method. 40a35e9
Contributor

zombor commented Apr 27, 2012

O_o

Please follow the development guidelines: https://github.com/kohana/kohana/wiki/developers

You need to open a redmine issue and do your pull request properly.

zombor closed this Apr 27, 2012

Contributor

EvanPurkhiser commented on e139a64 Aug 26, 2012

It doesn't look like this commit made it into v3.2.1, so the send_file functionality is actually still broken in v3.2.1 due to 3bc535e.

I've opened a ticket in redmine for this issue.

Member

Zeelot commented on 0128655 Oct 16, 2012

This seems wrong, we shouldn't be calling array_key_exists() on objects at all

Contributor

Ikke replied Nov 22, 2012

Not sure if I agree. Objects providing the array interface should be first class arrays (although, php doesn't treat them like that).

Member

Zeelot replied Nov 22, 2012

I mean it's wrong based on php telling us not to do it even though it seems to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment