diff --git a/app/AlbumDownloader.php b/app/AlbumDownloader.php index 8feaff98..9e79dae3 100644 --- a/app/AlbumDownloader.php +++ b/app/AlbumDownloader.php @@ -20,11 +20,19 @@ namespace Poniverse\Ponyfm; +use Poniverse\Ponyfm\Models\Album; use ZipStream; class AlbumDownloader { + /** + * @var Album + */ private $_album; + + /** + * @var string + */ private $_format; function __construct($album, $format) diff --git a/app/Models/Album.php b/app/Models/Album.php index 45025d66..a53356b7 100644 --- a/app/Models/Album.php +++ b/app/Models/Album.php @@ -32,6 +32,33 @@ use Poniverse\Ponyfm\Traits\TrackCollection; use Poniverse\Ponyfm\Traits\SlugTrait; use Venturecraft\Revisionable\RevisionableTrait; +/** + * Poniverse\Ponyfm\Models\Album + * + * @property integer $id + * @property integer $user_id + * @property string $title + * @property string $slug + * @property string $description + * @property integer $cover_id + * @property integer $track_count + * @property integer $view_count + * @property integer $download_count + * @property integer $favourite_count + * @property integer $comment_count + * @property \Carbon\Carbon $created_at + * @property string $updated_at + * @property \Carbon\Carbon $deleted_at + * @property-read \Poniverse\Ponyfm\Models\User $user + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\ResourceUser[] $users + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Favourite[] $favourites + * @property-read \Poniverse\Ponyfm\Models\Image $cover + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Track[] $tracks + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Comment[] $comments + * @property-read mixed $url + * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Album userDetails() + */ class Album extends Model { use SoftDeletes, SlugTrait, DispatchesJobs, TrackCollection, RevisionableTrait; diff --git a/app/Models/Comment.php b/app/Models/Comment.php index 7e66b628..2b71b549 100644 --- a/app/Models/Comment.php +++ b/app/Models/Comment.php @@ -23,6 +23,27 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +/** + * Poniverse\Ponyfm\Models\Comment + * + * @property integer $id + * @property integer $user_id + * @property string $ip_address + * @property string $content + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $profile_id + * @property integer $track_id + * @property integer $album_id + * @property integer $playlist_id + * @property-read \Poniverse\Ponyfm\Models\User $user + * @property-read \Poniverse\Ponyfm\Models\Track $track + * @property-read \Poniverse\Ponyfm\Models\Album $album + * @property-read \Poniverse\Ponyfm\Models\Playlist $playlist + * @property-read \Poniverse\Ponyfm\Models\User $profile + * @property-read mixed $resource + */ class Comment extends Model { diff --git a/app/Models/Favourite.php b/app/Models/Favourite.php index a916786e..912cf633 100644 --- a/app/Models/Favourite.php +++ b/app/Models/Favourite.php @@ -22,6 +22,22 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\Favourite + * + * @property integer $id + * @property integer $user_id + * @property integer $track_id + * @property integer $album_id + * @property integer $playlist_id + * @property string $created_at + * @property-read \Poniverse\Ponyfm\Models\User $user + * @property-read \Poniverse\Ponyfm\Models\Track $track + * @property-read \Poniverse\Ponyfm\Models\Album $album + * @property-read \Poniverse\Ponyfm\Models\Playlist $playlist + * @property-read mixed $resource + * @property-read mixed $type + */ class Favourite extends Model { protected $table = 'favourites'; diff --git a/app/Models/Follower.php b/app/Models/Follower.php index 143b88b4..3357e76d 100644 --- a/app/Models/Follower.php +++ b/app/Models/Follower.php @@ -22,6 +22,15 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\Follower + * + * @property integer $id + * @property integer $user_id + * @property integer $artist_id + * @property integer $playlist_id + * @property string $created_at + */ class Follower extends Model { protected $table = 'followers'; diff --git a/app/Models/Genre.php b/app/Models/Genre.php index d6f87511..1d1f3914 100644 --- a/app/Models/Genre.php +++ b/app/Models/Genre.php @@ -27,6 +27,20 @@ use Poniverse\Ponyfm\Traits\SlugTrait; use Illuminate\Database\Eloquent\Model; use Venturecraft\Revisionable\RevisionableTrait; +/** + * Poniverse\Ponyfm\Models\Genre + * + * @property integer $id + * @property string $name + * @property string $slug + * @property string $deleted_at + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Track[] $tracks + * @property-read \Poniverse\Ponyfm\Models\Track $trackCountRelation + * @property-read mixed $track_count + * @property-read mixed $url + * @property-write mixed $title + * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory + */ class Genre extends Model { protected $table = 'genres'; diff --git a/app/Models/Image.php b/app/Models/Image.php index 5784ba89..a964b702 100644 --- a/app/Models/Image.php +++ b/app/Models/Image.php @@ -25,6 +25,19 @@ use Illuminate\Database\Eloquent\Model; use Config; use Symfony\Component\HttpFoundation\File\UploadedFile; +/** + * Poniverse\Ponyfm\Models\Image + * + * @property integer $id + * @property string $filename + * @property string $mime + * @property string $extension + * @property integer $size + * @property string $hash + * @property integer $uploaded_by + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + */ class Image extends Model { const NORMAL = 1; diff --git a/app/Models/License.php b/app/Models/License.php index df9ea181..394d40aa 100644 --- a/app/Models/License.php +++ b/app/Models/License.php @@ -22,6 +22,16 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\License + * + * @property integer $id + * @property string $title + * @property string $description + * @property boolean $affiliate_distribution + * @property boolean $open_distribution + * @property boolean $remix + */ class License extends Model { protected $table = 'licenses'; diff --git a/app/Models/PinnedPlaylist.php b/app/Models/PinnedPlaylist.php index 0d55098d..6af92f4f 100644 --- a/app/Models/PinnedPlaylist.php +++ b/app/Models/PinnedPlaylist.php @@ -22,6 +22,17 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\PinnedPlaylist + * + * @property integer $id + * @property integer $user_id + * @property integer $playlist_id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property-read \Poniverse\Ponyfm\Models\User $user + * @property-read \Poniverse\Ponyfm\Models\Playlist $playlist + */ class PinnedPlaylist extends Model { protected $table = 'pinned_playlists'; diff --git a/app/Models/Playlist.php b/app/Models/Playlist.php index 7266aeef..cc3c3be2 100644 --- a/app/Models/Playlist.php +++ b/app/Models/Playlist.php @@ -31,6 +31,33 @@ use Poniverse\Ponyfm\Traits\TrackCollection; use Poniverse\Ponyfm\Traits\SlugTrait; use Venturecraft\Revisionable\RevisionableTrait; +/** + * Poniverse\Ponyfm\Models\Playlist + * + * @property integer $id + * @property integer $user_id + * @property string $title + * @property string $slug + * @property string $description + * @property boolean $is_public + * @property integer $track_count + * @property integer $view_count + * @property integer $download_count + * @property integer $favourite_count + * @property integer $follow_count + * @property integer $comment_count + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Track[] $tracks + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\ResourceUser[] $users + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Comment[] $comments + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\PinnedPlaylist[] $pins + * @property-read \Poniverse\Ponyfm\Models\User $user + * @property-read mixed $url + * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Playlist userDetails() + */ class Playlist extends Model { use SoftDeletes, SlugTrait, DispatchesJobs, TrackCollection, RevisionableTrait; diff --git a/app/Models/ResourceLogItem.php b/app/Models/ResourceLogItem.php index 42c29638..643be428 100644 --- a/app/Models/ResourceLogItem.php +++ b/app/Models/ResourceLogItem.php @@ -26,6 +26,19 @@ use Auth; use DB; use Request; +/** + * Poniverse\Ponyfm\Models\ResourceLogItem + * + * @property integer $id + * @property integer $user_id + * @property integer $log_type + * @property string $ip_address + * @property integer $track_format_id + * @property integer $track_id + * @property integer $album_id + * @property integer $playlist_id + * @property \Carbon\Carbon $created_at + */ class ResourceLogItem extends Model { protected $table = 'resource_log_items'; diff --git a/app/Models/ResourceUser.php b/app/Models/ResourceUser.php index 11386ac2..5b1413af 100644 --- a/app/Models/ResourceUser.php +++ b/app/Models/ResourceUser.php @@ -22,6 +22,22 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\ResourceUser + * + * @property integer $id + * @property integer $user_id + * @property integer $track_id + * @property integer $album_id + * @property integer $playlist_id + * @property integer $artist_id + * @property boolean $is_followed + * @property boolean $is_favourited + * @property boolean $is_pinned + * @property integer $view_count + * @property integer $play_count + * @property integer $download_count + */ class ResourceUser extends Model { protected $table = 'resource_users'; diff --git a/app/Models/Role.php b/app/Models/Role.php index 66e2ca19..19ca1b48 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -22,6 +22,13 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\Role + * + * @property integer $id + * @property string $name + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\User[] $users + */ class Role extends Model { protected $table = 'roles'; diff --git a/app/Models/ShowSong.php b/app/Models/ShowSong.php index 92213cf3..8b14f466 100644 --- a/app/Models/ShowSong.php +++ b/app/Models/ShowSong.php @@ -22,6 +22,14 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\ShowSong + * + * @property integer $id + * @property string $title + * @property string $lyrics + * @property string $slug + */ class ShowSong extends Model { protected $table = 'show_songs'; diff --git a/app/Models/Track.php b/app/Models/Track.php index 73f0cdc1..05dbe981 100644 --- a/app/Models/Track.php +++ b/app/Models/Track.php @@ -36,6 +36,63 @@ use Illuminate\Support\Str; use Log; use Venturecraft\Revisionable\RevisionableTrait; +/** + * Poniverse\Ponyfm\Models\Track + * + * @property integer $id + * @property integer $user_id + * @property integer $license_id + * @property integer $genre_id + * @property integer $track_type_id + * @property string $title + * @property string $slug + * @property string $description + * @property string $lyrics + * @property boolean $is_vocal + * @property boolean $is_explicit + * @property integer $cover_id + * @property boolean $is_downloadable + * @property float $duration + * @property integer $play_count + * @property integer $view_count + * @property integer $download_count + * @property integer $favourite_count + * @property integer $comment_count + * @property \Carbon\Carbon $created_at + * @property string $updated_at + * @property \Carbon\Carbon $deleted_at + * @property \Carbon\Carbon $published_at + * @property \Carbon\Carbon $released_at + * @property integer $album_id + * @property integer $track_number + * @property boolean $is_latest + * @property string $hash + * @property boolean $is_listed + * @property string $source + * @property string $original_tags + * @property string $metadata + * @property-read \Poniverse\Ponyfm\Models\Genre $genre + * @property-read \Poniverse\Ponyfm\Models\TrackType $trackType + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Comment[] $comments + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Favourite[] $favourites + * @property-read \Poniverse\Ponyfm\Models\Image $cover + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\ShowSong[] $showSongs + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\ResourceUser[] $users + * @property-read \Poniverse\Ponyfm\Models\User $user + * @property-read \Poniverse\Ponyfm\Models\Album $album + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\TrackFile[] $trackFiles + * @property-read mixed $year + * @property-read mixed $url + * @property-read mixed $download_directory + * @property-read mixed $status + * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track userDetails() + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track published() + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track listed() + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track explicitFilter() + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track withComments() + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\Track mlpma() + */ class Track extends Model { use SoftDeletes; diff --git a/app/Models/TrackFile.php b/app/Models/TrackFile.php index b5089c44..ef263ee6 100644 --- a/app/Models/TrackFile.php +++ b/app/Models/TrackFile.php @@ -26,6 +26,24 @@ use Illuminate\Database\Eloquent\Model; use App; use File; +/** + * Poniverse\Ponyfm\Models\TrackFile + * + * @property integer $id + * @property integer $track_id + * @property boolean $is_master + * @property string $format + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property boolean $is_cacheable + * @property boolean $status + * @property string $expires_at + * @property integer $filesize + * @property-read \Poniverse\Ponyfm\Models\Track $track + * @property-read mixed $extension + * @property-read mixed $url + * @property-read mixed $size + */ class TrackFile extends Model { // used for the "status" property diff --git a/app/Models/TrackType.php b/app/Models/TrackType.php index 6973c49e..464f7a38 100644 --- a/app/Models/TrackType.php +++ b/app/Models/TrackType.php @@ -22,6 +22,13 @@ namespace Poniverse\Ponyfm\Models; use Illuminate\Database\Eloquent\Model; +/** + * Poniverse\Ponyfm\Models\TrackType + * + * @property integer $id + * @property string $title + * @property string $editor_title + */ class TrackType extends Model { protected $table = 'track_types'; diff --git a/app/Models/User.php b/app/Models/User.php index 07ddec4e..9a956028 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -31,6 +31,37 @@ use Auth; use Illuminate\Support\Str; use Venturecraft\Revisionable\RevisionableTrait; +/** + * Poniverse\Ponyfm\Models\User + * + * @property integer $id + * @property string $display_name + * @property string $username + * @property boolean $sync_names + * @property string $email + * @property string $gravatar + * @property string $slug + * @property boolean $uses_gravatar + * @property boolean $can_see_explicit_content + * @property string $bio + * @property integer $track_count + * @property integer $comment_count + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $avatar_id + * @property string $remember_token + * @property boolean $is_archived + * @property \Carbon\Carbon $disabled_at + * @property-read \Poniverse\Ponyfm\Models\Image $avatar + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\ResourceUser[] $users + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Role[] $roles + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Comment[] $comments + * @property-read \Illuminate\Database\Eloquent\Collection|\Poniverse\Ponyfm\Models\Track[] $tracks + * @property-read mixed $url + * @property-read mixed $message_url + * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory + * @method static \Illuminate\Database\Query\Builder|\Poniverse\Ponyfm\Models\User userDetails() + */ class User extends Model implements AuthenticatableContract, CanResetPasswordContract, \Illuminate\Contracts\Auth\Access\Authorizable { use Authenticatable, CanResetPassword, Authorizable, RevisionableTrait; diff --git a/app/PlaylistDownloader.php b/app/PlaylistDownloader.php index a145c906..5687783c 100644 --- a/app/PlaylistDownloader.php +++ b/app/PlaylistDownloader.php @@ -20,11 +20,19 @@ namespace Poniverse\Ponyfm; +use Poniverse\Ponyfm\Models\Playlist; use ZipStream; class PlaylistDownloader { + /** + * @var Playlist + */ private $_playlist; + + /** + * @var string + */ private $_format; function __construct($playlist, $format) diff --git a/config/ide-helper.php b/config/ide-helper.php new file mode 100644 index 00000000..8991b930 --- /dev/null +++ b/config/ide-helper.php @@ -0,0 +1,119 @@ + '_ide_helper', + 'format' => 'php', + + /* + |-------------------------------------------------------------------------- + | Helper files to include + |-------------------------------------------------------------------------- + | + | Include helper files. By default not included, but can be toggled with the + | -- helpers (-H) option. Extra helper files can be included. + | + */ + + 'include_helpers' => false, + + 'helper_files' => array( + base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php', + ), + + /* + |-------------------------------------------------------------------------- + | Model locations to include + |-------------------------------------------------------------------------- + | + | Define in which directories the ide-helper:models command should look + | for models. + | + */ + + 'model_locations' => array( + 'app/Models', + ), + + + /* + |-------------------------------------------------------------------------- + | Extra classes + |-------------------------------------------------------------------------- + | + | These implementations are not really extended, but called with magic functions + | + */ + + 'extra' => array( + 'Eloquent' => array('Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'), + 'Session' => array('Illuminate\Session\Store'), + ), + + 'magic' => array( + 'Log' => array( + 'debug' => 'Monolog\Logger::addDebug', + 'info' => 'Monolog\Logger::addInfo', + 'notice' => 'Monolog\Logger::addNotice', + 'warning' => 'Monolog\Logger::addWarning', + 'error' => 'Monolog\Logger::addError', + 'critical' => 'Monolog\Logger::addCritical', + 'alert' => 'Monolog\Logger::addAlert', + 'emergency' => 'Monolog\Logger::addEmergency', + ) + ), + + /* + |-------------------------------------------------------------------------- + | Interface implementations + |-------------------------------------------------------------------------- + | + | These interfaces will be replaced with the implementing class. Some interfaces + | are detected by the helpers, others can be listed below. + | + */ + + 'interfaces' => array( + + ), + + /* + |-------------------------------------------------------------------------- + | Support for custom DB types + |-------------------------------------------------------------------------- + | + | This setting allow you to map any custom database type (that you may have + | created using CREATE TYPE statement or imported using database plugin + | / extension to a Doctrine type. + | + | Each key in this array is a name of the Doctrine2 DBAL Platform. Currently valid names are: + | 'postgresql', 'db2', 'drizzle', 'mysql', 'oracle', 'sqlanywhere', 'sqlite', 'mssql' + | + | This name is returned by getName() method of the specific Doctrine/DBAL/Platforms/AbstractPlatform descendant + | + | The value of the array is an array of type mappings. Key is the name of the custom type, + | (for example, "jsonb" from Postgres 9.4) and the value is the name of the corresponding Doctrine2 type (in + | our case it is 'json_array'. Doctrine types are listed here: + | http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html + | + | So to support jsonb in your models when working with Postgres, just add the following entry to the array below: + | + | "postgresql" => array( + | "jsonb" => "json_array", + | ), + | + */ + 'custom_db_types' => array( + + ), + +);