{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/16607","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/16607/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/16607/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/16607/events","html_url":"https://github.com/yiisoft/yii2/issues/16607","id":347614516,"node_id":"MDU6SXNzdWUzNDc2MTQ1MTY=","number":16607,"title":"PHP 7 ::class and AssetManager.bundles","user":{"login":"shranet","id":1712200,"node_id":"MDQ6VXNlcjE3MTIyMDA=","avatar_url":"https://avatars1.githubusercontent.com/u/1712200?v=4","gravatar_id":"","url":"https://api.github.com/users/shranet","html_url":"https://github.com/shranet","followers_url":"https://api.github.com/users/shranet/followers","following_url":"https://api.github.com/users/shranet/following{/other_user}","gists_url":"https://api.github.com/users/shranet/gists{/gist_id}","starred_url":"https://api.github.com/users/shranet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shranet/subscriptions","organizations_url":"https://api.github.com/users/shranet/orgs","repos_url":"https://api.github.com/users/shranet/repos","events_url":"https://api.github.com/users/shranet/events{/privacy}","received_events_url":"https://api.github.com/users/shranet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-04T12:12:31Z","updated_at":"2018-08-04T12:41:59Z","closed_at":null,"author_association":"NONE","body":"I don't know this bug or not!\r\n\r\nI'm using https://github.com/froala/yii2-froala-editor in my project. If you see bellow code, jquery depends defined as '\\yii\\web\\JqueryAsset'.\r\n\r\nhttps://github.com/froala/yii2-froala-editor/blob/d88ae645f57b1aa6fccb1e87f78207e86785d0f1/src/FroalaEditorAsset.php#L46-L50\r\n\r\nI use JqueryAsset in my project like this:\r\n\r\n```\r\npublic $depends = [\r\n    JqueryAsset::class\r\n];\r\n```\r\n\r\nIf I want to use .min version of Jquery, I need change AssetManager.bundles to (config/web.php):\r\n\r\n```\r\n'assetManager' => [\r\n    'class' => 'yii\\web\\AssetManager',\r\n    'bundles' => [\r\n        '\\yii\\web\\JqueryAsset' => [\r\n            'js' => [\r\n                YII_ENV_DEV ? 'jquery.js' : 'jquery.min.js'\r\n            ]\r\n        ]\r\n    ]\r\n]\r\n```\r\n\r\nIn debug mode all works correctly, but in production mode works incorrectly.\r\n\r\n<img width=\"536\" alt=\"yii2-bug\" src=\"https://user-images.githubusercontent.com/1712200/43676358-25d5cd42-9809-11e8-82dc-b97eb72b2107.png\">\r\n\r\nNow, to fix the error I use following code:\r\n```\r\n'assetManager' => [\r\n    'class' => 'yii\\web\\AssetManager',\r\n    'bundles' => [\r\n        '\\yii\\web\\JqueryAsset' => [\r\n            'js' => [\r\n                YII_ENV_DEV ? 'jquery.js' : 'jquery.min.js'\r\n            ]\r\n        ],\r\n        'yii\\web\\JqueryAsset' => [\r\n            'js' => [\r\n                YII_ENV_DEV ? 'jquery.js' : 'jquery.min.js'\r\n            ]\r\n        ],\r\n    ]\r\n]\r\n```\r\n\r\n\r\n\r\n| Q                | A\r\n| ---------------- | ---\r\n| Yii version      | 2.0.15\r\n| PHP version      | 7.2.7\r\n| Operating system | MacOS High Sierra (10.13.6)\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/410446873","html_url":"https://github.com/yiisoft/yii2/issues/16607#issuecomment-410446873","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/16607","id":410446873,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDQ0Njg3Mw==","user":{"login":"rob006","id":5972388,"node_id":"MDQ6VXNlcjU5NzIzODg=","avatar_url":"https://avatars2.githubusercontent.com/u/5972388?v=4","gravatar_id":"","url":"https://api.github.com/users/rob006","html_url":"https://github.com/rob006","followers_url":"https://api.github.com/users/rob006/followers","following_url":"https://api.github.com/users/rob006/following{/other_user}","gists_url":"https://api.github.com/users/rob006/gists{/gist_id}","starred_url":"https://api.github.com/users/rob006/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob006/subscriptions","organizations_url":"https://api.github.com/users/rob006/orgs","repos_url":"https://api.github.com/users/rob006/repos","events_url":"https://api.github.com/users/rob006/events{/privacy}","received_events_url":"https://api.github.com/users/rob006/received_events","type":"User","site_admin":false},"created_at":"2018-08-04T12:41:59Z","updated_at":"2018-08-04T12:41:59Z","author_association":"MEMBER","body":"Class names should be defined without leading backslash, so this is bug in `froala/yii2-froala-editor`. We may try to trim leading backslashes, but I'm not sure if it is worth the trouble."}}
{"actor":{"display_login":"rob006"}}