Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Add median and mode functions to collections #14305

Merged
merged 2 commits into from
Jul 18, 2016
Merged

[5.2] Add median and mode functions to collections #14305

merged 2 commits into from
Jul 18, 2016

Conversation

amonger
Copy link
Contributor

@amonger amonger commented Jul 13, 2016

I found I needed this recently so figured I'd share.

This adds the median and mode to the collection class in a similar way to how average works.

@amonger amonger changed the title Add median and mode functions to collections [5.2] Add median and mode functions to collections Jul 13, 2016
@taylorotwell taylorotwell merged commit a4c39aa into laravel:5.2 Jul 18, 2016
appleboy pushed a commit to laravel-taiwan/docs that referenced this pull request Jul 8, 2017
* Correct the note regarding assertJson

* Add view() usage information to notifications

* Add note about assertJsonStructure()

* adjust wordin

* remove second param

* Fix typo in Filesystem doc

* update wording

* Document Passport::actingAs()

*          document the changes in model create and forceCreate

* update wording

*        add notes about bind and instance

* update wording

* add note on optional fields

* remove word

* add note on normaliation

* add note about autoloading

*    document assertJsonFragment

*    minor edit

* Update Mix documentation about `version`

* spelling

* Example for redirectTo() Method

Add simple return example, to clarify redirectTo() method, if used, should return a path string.

* document intersect method

* Added changes to Event Fake changes

added changes for `assertNotFired` to `assertNotDispatched`

* Document Route::resourceVerbs() method

* Update upgrade.md

* fix wording

* wording

*    use BrowserKitTestCase

* fix: remove comma

* Better wording for Cashier warning

* update docs

* Remove compiled.php to upgrade guide

laravel/framework#17003 (comment)

* Update upgrade.md

* Fix method name in dusk.md

Method is called `elements`

* Change PHPUnit to 5.7

composer.json has been updated a week ago;
laravel/laravel@926f53b

* give more clarity

* Correct reference to resources directory name

When describing the resource_path() helper, there was an incorrect mention of the storage directory. Likely due to copy & paste.

* Update http-tests.md

Tests are now using namespaces. We need to access global scope for User::class

* import class

* 📝 add documentation for collection when method

Documentation for the collection `when` method introduced in
laravel/framework#17917.

* update wording

* added to docs

* use correct name of method

* Adding brackets.

* Changing heading

* Removing references to the .homestead directory.

This commit (laravel/homestead@06b52c7) removes the `.homestead` directory, placing the `Homestead.yaml` file in the Homestead directory instead.

* Add missing config entry.

* Update notifications.md

* work on docs

* add notes for random dropdown selection

related to this Dusk PR

laravel/dusk#140

* Update dusk.md

* Updated dusk.md

Add docs for radio selection assertions
re: laravel/dusk#138

* Added note about indentation level on markdown emails

* adjust wording

* Removes PM2 from homestead docs

Not included in vagrant box

* Extend Mix docs

* fix formatting and wording

* fix mistake in stylus

* Fix typo in Homestead doc

* ✨ 📚 Add JSON Config info, share() docs, notes about using stable versions

* Replace htmlentities with htmlspecialchars

* fix various errors and problems

* Use path to sass instead of less

* use uri() instead of getPath() for Route

* Replace "login" with "log in"

* Add note about the removal of the ConfigureLogging

As per this commit the ConfigureLogging bootstrapper is no more in 5.4 with the Monolog setup being moved to a base service provider in Illuminate\Foundation\Application laravel/framework@919f21b#diff-67364880bdf444edbf5e384f3686b9b9

* update dusk.md

Added queryString assertions to list of available assertions.

* Update homestead.md

* added docs for testing file uploads

* More clarification of the example commands used.

* Document Collection::whereNotIn()

* Update mix.md

>Behind the scenes, Mix will download and include the appropriate `babel-preset-react` Babel plug-in.

It used to say:

>Behind the scenes, React will download and include the appropriate `babel-preset-react` Babel plug-in.

* Update collections.md

* fix wording

* Change dot to semicolon

* Update mix.md

Add missing word.

* Update structure

Add `channels,php` to `routes` directory.

* Update structure.md

* Add new drag methods to documentation

* fix formatting

* Terminable route middleware clarification

There was some confusion with some developers because the documentation seemed to say that terminable middleware has to be defined in your *global* middleware list, but in fact terminable middleware can be used as *route* middleware as well.

* Update middleware.md

* e function sets double_encode to false

This behaviour is not intuitive as the parameter is set to true per default in htmlspecialchars.

* Fixed typo error.

* Added kebab_case() to the string helpers

Was this method not documented so it will not break the 6 methods per column on 3 columns?

* Added kebab_case() to the string helpers

Was this method not documented so it will not break the 6 methods per column on 3 columns?

* Update helpers.md

* Mention the array_wrap helper

* tweak wording

* changes for custom pivot table model

The pivot model must extend the the relations/pivot class

* Adding semicolon.

* Fixed typo

* Update authorization.md

Include namespace in 'Actions that don't require models' in the Blade section

* Added description for getMessage() in Error pages

$exception variable has methods for displaying the message passed by the abort function, which can be useful in Custom HTTP Error Pages. The proposed changes mention this method with an example for blade template under - "Custom HTTP Error Pages" section.

* Update queries.md

MariaDB already support JSON functions. refer [here](https://mariadb.com/kb/en/mariadb/json-functions/)

* Update queries.md

* Update errors.md

* Update errors.md

* Document Eloquent\Builder::withCount() aliasing support

Documents the feature added by laravel/framework#15279

* tweak formatting

* update example

* document csrf

* clear up wording

* Fixes syntax error

minor syntax error in docs

* Adding getForeignKey rename to upgrade guide

* move docs

* document customization

* Update views.md

* Corrected wrong example code (in sync with master)

The master branch has updated the docs, making the same changes in 5.4

https://github.com/laravel/docs/blob/master/eloquent-relationships.md#many-to-many

* Fix React anchor link. Updated to #react to match section heading

* Update v5.4 Upgrade Guide

Currently the Upgrade guide references a change in the API to
relations where the name of the `getForeignKey` method has changed
to `getForeignKeyName`  In reviewing the code and API docs this
doesn't seem to actually be true.

Example (https://laravel.com/api/5.4/Illuminate/Database/Eloquent/Relations/BelongsTo.html)

This commit removes the seemingly false reference.

* Document Collection::isNotEmpty() method

Documents the feature added by laravel/framework#16797

* Document Collection::containsStrict() method

Documents the feature added by laravel/framework#14657

Also updates the Collection::contains() documentation to outline its behavior and where they differ.

* Document Collection::median() and Collection::mode() methods

Documents the features added by laravel/framework#14305

I also changed the Collection::avg() documentation with the same code snippet to better demonstrate where they differ since they all are related. Since they can be confusing to understand, I also added reference links to Wikipedia to each one.

* [5.4] Document Collection::uniqueStrict() method

Documents the feature added by laravel/framework#14661

Also updates the Collection::unique() documentation to outline its behavior and where they differ.

* [5.4] Document Collection::tap() method

Documents the feature added by laravel/framework#17756

* [5.4] Sync Eloquent\Collection available methods

* Fix reference to getMessage in exception

* Improvements to collections documentation

* Correct example for sending markdown slack attachements

* Update use statement

https://github.com/laravel/laravel/blob/master/app/Providers/AuthServiceProvider.php#L6

* Update scheduling.md file

I feel like the '/path/to/artisan' is a bit confusing a better use of words would be 'path-to-your-project'.

I also found out there are some more people thinking like me:
https://laracasts.com/discuss/channels/laravel/pathtoartisan-where-it-is?page=1

* add notes on laravel version scheme

* Clarifies tests namespace change

Makes clear the composer.json's change is required even for those who skip the "Running Laravel 5.3 & 5.4 Tests In A Single Application" section.

* [5.4] Change user_id to unsigned integer

In the session database table, user_id should be an unsigned integer.

*           add docs for running dusk on travis and circleci

* fix

* Semantic Versioning paragraph small typo fix.

* tweak wording

*     fix CircleCI formatting

* Update facades.md

* Update facades.md

* Added `deleteFileAfterSend()` back in the docs

it is a feature.

* wip

* Document Collection::times() method and flatMap shortcut

* Update collections.md

* Improve the environment configuration documentation

- Moves two general-topic paragraphs from "Retrieving Environment Configuration" sub-section into the main "Environment Configuration" section
- Adds a security note about committing .env files
- Adds a general note to clarify that .env files variables can be overridden by external environment variables
- Makes the "Retrieving Environment Configuration" sub-section linkable
- Adds a tip to the "Determining The Current Environment" sub-section to mention that the APP_ENV variable could be overridden at server-level configuration

* Change word.

* adjust wording and tips

* remove section from docs... php has built in ?? operator

* Clarify 2nd argument of firstOrNew & firstOrCreate

* Update charset/collation

* adjust wording

* Document the Mailable callbacks functionality

* Fix event-fake link

Replace old "mocking-events" to "event-fake" HTML ID

* clean up some documentation

* clarify `optional` and `present`

* clarify note

* Add Documentation for new Blade directives @empty & @Isset

* Adds `assertJsonFragmentMission()` to the list of available testing methods

Signed-off-by: Jesse Schutt <jesse.schutt@zaengle.com>

* Update http-tests.md

* adjust wording

* adjust wording

* @empty checks if $records is empty

* Update query builder JSON docs

* Update homestead.md

* Document "flatten" parameter of mix.copy()

* fix example

* add note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants