# deprecationWarning function not working?

**URL:** <https://discourse.cakephp.org/t/deprecationwarning-function-not-working/6150>\
**Category:** Need Help\
**Created:** [May 24, 2019, 4:12pm UTC](https://discourse.cakephp.org/t/deprecationwarning-function-not-working/6150 "2019-05-24T16:12:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FinlayDaG33k](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/finlaydag33k/32/1049_2.png) [@FinlayDaG33k](https://discourse.cakephp.org/u/FinlayDaG33k)\
**Post date:** [May 24, 2019, 4:12pm UTC](https://discourse.cakephp.org/t/deprecationwarning-function-not-working/6150/1 "2019-05-24T16:12:53Z")

</div>

Hii there,

My project wants to deprecate an method but, of course, we want to inform the devs about it.  
For this, we’ve called the `deprecationWarning()` function in the app, opened the app, checked the DebugKit… and nothing?

Is there something I’m doing wrong or is it broken?

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [May 25, 2019, 5:12am UTC](https://discourse.cakephp.org/t/deprecationwarning-function-not-working/6150/2 "2019-05-25T05:12:12Z")

</div>

probably [https://book.cakephp.org/3.0/en/appendices/3-2-migration-guide.html#disabling-deprecation-warnings](https://book.cakephp.org/3.0/en/appendices/3-2-migration-guide.html#disabling-deprecation-warnings)

`deprecationWarning` checks for `E_USER_DEPRECATED` flag [https://github.com/cakephp/cakephp/blob/0decd7560d7edf24627484d4b04fb96ebe19f46b/src/Core/functions.php#L292](https://github.com/cakephp/cakephp/blob/0decd7560d7edf24627484d4b04fb96ebe19f46b/src/Core/functions.php#L292)

---

<div class="post-metadata">

**Author:** ![FinlayDaG33k](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/finlaydag33k/32/1049_2.png) [@FinlayDaG33k](https://discourse.cakephp.org/u/FinlayDaG33k)\
**Post date:** [May 25, 2019, 11:04am UTC](https://discourse.cakephp.org/t/deprecationwarning-function-not-working/6150/3 "2019-05-25T11:04:42Z")

</div>

Hii there,

We had set our errorLevel to `E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED` a while ago because CakePHP threw the deprecation errors in the main app itself as well (instead of only in the debug bar).  
Do you know of a way to circumvent this?

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [May 27, 2019, 9:37am UTC](https://discourse.cakephp.org/t/deprecationwarning-function-not-working/6150/4 "2019-05-27T09:37:31Z")

</div>

nope sorry, currently im using GraphQL and i can just set any field as deprecated but i dont know would i do it in normal way, probably just throw exception with deprecated message with code 410 (GONE) or with hint to other method 301 (MOVED PERMANENTLY)
